title: Getting a list of keys based on another property in json with jq
body: <p>I'm trying to create a jq filter for JSON, similar to <a href="https://stackoverflow.com/questions/26701538/how-to-filter-an-array-of-objects-based-on-values-in-an-inner-array-with-jq">How to filter an array of objects based on values in an inner array with jq?</a> - but even using that as a basis doesn't seem to be giving me the results I want.</p>
  
  <p>Here's my example json</p>
  
  <pre><code>[{"id":"0001","tags":["one","two"]},{"id":"0002", "tags":["two"]}]
  </code></pre>
  
  <p>I want to return a list of IDs where tags contains "one" (not partial string match, full element match).</p>
  
  <p>I have tried some variations, but can't get the filter right.</p>
  
  <pre><code>. - map(select(.resources[] | contains("one"))) | .[] .id
  </code></pre>
  
  <p>Returns <code>"0001","0002"</code></p>
  
  <p>Have also tried <code>... .resources[].one)) | ...</code> but always get full list when trying to filter by "one" and expecting to only get <code>0001</code></p>
  
  <p>Where am I filtering wrong? (have about 30 minutes experience with jq, so please excuse my ignorance if it's something obvious :)</p>