title: How to add tag inside a nest depending on a variable while keeping rest of json
body: <p>I'm failry new to jq and I've learned to do most things on my own but I'm hitting my head on my keyboard for this one.   Look at the following json</p>
  
  <p>JSON:</p>
  
  <pre><code>  {
    "importType": "Upsert",
    "immediateDeployment": false,
    "isIgnoreNulls": false,
    "isOverwriteNullsOnly": false,
    "isPreferredandSync": false,
    "outputLayout": {
      "fields": [
        {
          "name": "TEMP_KEY",
          "type": "String",
          "length": "2000",
          "displayName": "TEMP_KEY"
        },
        {
          "name": "LoadSeqNum",
          "type": "String",
          "length": "2000",
          "displayName": "LoadSeqNum"
        }
      ]
    }
  }
  </code></pre>
  
  <p>What I'm trying to do is inside of .outputLayout.fields[] I want to create a new pair called "isIdentifier" where it is true if the .outputLayout.fields[].name is LoadSeqNum and false if it's not but I need to keep the rest of the json just as it is.  So target should look as following:</p>
  
  <p>Goal:</p>
  
  <pre><code>  {
    "importType": "Upsert",
    "immediateDeployment": false,
    "isIgnoreNulls": false,
    "isOverwriteNullsOnly": false,
    "isPreferredandSync": false,
    "outputLayout": {
      "fields": [
        {
          "name": "TEMP_KEY",
          "type": "String",
          "length": "2000",
          "displayName": "TEMP_KEY"
          "isIdentifier": false
        },
        {
          "name": "LoadSeqNum",
          "type": "String",
          "length": "2000",
          "displayName": "LoadSeqNum"
          "isIdentifier": true
        }
      ]
    }
  }
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>jq '.outputLayout.fields[] | . + {"isIdentifier": (if (.name)=="LoadSeqNum" then true else false end)}'
  </code></pre>
  
  <p>But of course I'm missing all the higher level things.  When I try to do:</p>
  
  <pre><code>.outputLayout.fields[].isIdentifier=(if (.outputLayout.fields[].name)=="LoadSeqNum" then true else false end)
  </code></pre>
  
  <p>I get the whole thing twice, once with both true and the other one with both false.  I understand why it's doing that but I'm having a tough time figuring out what would work.  Any help or point in right direction?</p>