title: I cannot get jq to give me the value I'm looking for.
body: <p>I'm trying to use jq to get a value from the JSON that cURL returns. </p>
  
  <p>This is the JSON cURL passes to jq (and, FTR, I want jq to return "VALUE-I-WANT" without the quotation marks):</p>
  
  <pre><code>[  
     {  
        "success":{  
           "username":"VALUE-I-WANT"
        }
     }
  ]
  </code></pre>
  
  <p>I initially tried this:</p>
  
  <pre><code>jq ' . | .success | .username'
  </code></pre>
  
  <p>and got</p>
  
  <pre><code>jq: error (at &lt;stdin&gt;:0): Cannot index array with string "success"
  </code></pre>
  
  <p>I then tried a bunch of variations, with no luck.</p>
  
  <p>With a bunch of searching the web, I found <a href="https://stackoverflow.com/questions/34543829/jq-cannot-index-array-with-string">this SE entry</a>, and thought it might have been my saviour (spoiler, it wasn't). But it led me to try these:</p>
  
  <pre><code>jq -r '.[].success.username'
  jq -r '.[].success'
  </code></pre>
  
  <p>They didn't return an error, they returned "null". Which may or may not be an improvement. </p>
  
  <p>Can anybody tell me what I'm doing wrong here? And why it's wrong?  </p>