title: Fuzzy match string with jq
body: <p>Let's say I have some JSON in a file, it's a subset of JSON data extracted from a larger JSON file - that's why I'll use <code>stream</code> later in my attempted solution - and it looks like this:</p>
  <pre><code>[
  {&quot;_id&quot;:&quot;1&quot;,&quot;@&quot;:{},&quot;article&quot;:false,&quot;body&quot;:&quot;Hello world&quot;,&quot;comments&quot;:&quot;3&quot;,&quot;createdAt&quot;:&quot;20201007200628&quot;,&quot;creator&quot;:{&quot;id&quot;:&quot;4a7ba8fd719d43598b977dd548eed6aa&quot;,&quot;bio&quot;:&quot;&quot;,&quot;blocked&quot;:false,&quot;followed&quot;:false,&quot;human&quot;:false,&quot;integration&quot;:false,&quot;joined&quot;:&quot;20201007200628&quot;,&quot;muted&quot;:false,&quot;name&quot;:&quot;mkscott&quot;,&quot;rss&quot;:false,&quot;private&quot;:false,&quot;username&quot;:&quot;mkscott&quot;,&quot;verified&quot;:false,&quot;verifiedComments&quot;:false,&quot;badges&quot;:[],&quot;score&quot;:&quot;0&quot;,&quot;interactions&quot;:258,&quot;state&quot;:1},&quot;depth&quot;:&quot;0&quot;,&quot;depthRaw&quot;:0,&quot;hashtags&quot;:[],&quot;id&quot;:&quot;2d4126e342ed46509b55facb49b992a5&quot;,&quot;impressions&quot;:&quot;3&quot;,&quot;links&quot;:[],&quot;sensitive&quot;:false,&quot;state&quot;:4,&quot;upvotes&quot;:&quot;0&quot;},
  {&quot;_id&quot;:&quot;2&quot;,&quot;@&quot;:{},&quot;article&quot;:false,&quot;body&quot;:&quot;Goodbye world&quot;,&quot;comments&quot;:&quot;3&quot;,&quot;createdAt&quot;:&quot;20201007200628&quot;,&quot;creator&quot;:{&quot;id&quot;:&quot;4a7ba8fd719d43598b977dd548eed6aa&quot;,&quot;bio&quot;:&quot;&quot;,&quot;blocked&quot;:false,&quot;followed&quot;:false,&quot;human&quot;:false,&quot;integration&quot;:false,&quot;joined&quot;:&quot;20201007200628&quot;,&quot;muted&quot;:false,&quot;name&quot;:&quot;mkscott&quot;,&quot;rss&quot;:false,&quot;private&quot;:false,&quot;username&quot;:&quot;mkscott&quot;,&quot;verified&quot;:false,&quot;verifiedComments&quot;:false,&quot;badges&quot;:[],&quot;score&quot;:&quot;0&quot;,&quot;interactions&quot;:258,&quot;state&quot;:1},&quot;depth&quot;:&quot;0&quot;,&quot;depthRaw&quot;:0,&quot;hashtags&quot;:[],&quot;id&quot;:&quot;2d4126e342ed46509b55facb49b992a5&quot;,&quot;impressions&quot;:&quot;3&quot;,&quot;links&quot;:[],&quot;sensitive&quot;:false,&quot;state&quot;:4,&quot;upvotes&quot;:&quot;0&quot;}
  ],
  [
  {&quot;_id&quot;:&quot;55&quot;,&quot;@&quot;:{},&quot;article&quot;:false,&quot;body&quot;:&quot;Hello world&quot;,&quot;comments&quot;:&quot;3&quot;,&quot;createdAt&quot;:&quot;20201007200628&quot;,&quot;creator&quot;:{&quot;id&quot;:&quot;3a7ba8fd719d43598b977dd548eed6aa&quot;,&quot;bio&quot;:&quot;&quot;,&quot;blocked&quot;:false,&quot;followed&quot;:false,&quot;human&quot;:false,&quot;integration&quot;:false,&quot;joined&quot;:&quot;20201007200628&quot;,&quot;muted&quot;:false,&quot;name&quot;:&quot;mkscott&quot;,&quot;rss&quot;:false,&quot;private&quot;:false,&quot;username&quot;:&quot;jkscott&quot;,&quot;verified&quot;:false,&quot;verifiedComments&quot;:false,&quot;badges&quot;:[],&quot;score&quot;:&quot;0&quot;,&quot;interactions&quot;:258,&quot;state&quot;:1},&quot;depth&quot;:&quot;0&quot;,&quot;depthRaw&quot;:0,&quot;hashtags&quot;:[],&quot;id&quot;:&quot;2d4126e342ed46509b55facb49b992a5&quot;,&quot;impressions&quot;:&quot;3&quot;,&quot;links&quot;:[],&quot;sensitive&quot;:false,&quot;state&quot;:4,&quot;upvotes&quot;:&quot;0&quot;},
  {&quot;_id&quot;:&quot;56&quot;,&quot;@&quot;:{},&quot;article&quot;:false,&quot;body&quot;:&quot;Goodbye world&quot;,&quot;comments&quot;:&quot;3&quot;,&quot;createdAt&quot;:&quot;20201007200628&quot;,&quot;creator&quot;:{&quot;id&quot;:&quot;3a7ba8fd719d43598b977dd548eed6aa&quot;,&quot;bio&quot;:&quot;&quot;,&quot;blocked&quot;:false,&quot;followed&quot;:false,&quot;human&quot;:false,&quot;integration&quot;:false,&quot;joined&quot;:&quot;20201007200628&quot;,&quot;muted&quot;:false,&quot;name&quot;:&quot;mkscott&quot;,&quot;rss&quot;:false,&quot;private&quot;:false,&quot;username&quot;:&quot;jkscott&quot;,&quot;verified&quot;:false,&quot;verifiedComments&quot;:false,&quot;badges&quot;:[],&quot;score&quot;:&quot;0&quot;,&quot;interactions&quot;:258,&quot;state&quot;:1},&quot;depth&quot;:&quot;0&quot;,&quot;depthRaw&quot;:0,&quot;hashtags&quot;:[],&quot;id&quot;:&quot;2d4126e342ed46509b55facb49b992a5&quot;,&quot;impressions&quot;:&quot;3&quot;,&quot;links&quot;:[],&quot;sensitive&quot;:false,&quot;state&quot;:4,&quot;upvotes&quot;:&quot;0&quot;}
  ]
  </code></pre>
  <p>It describes 4 posts written by 2 different authors, with unique <code>_id</code> fields for each post. Both authors wrote 2 posts, where 1 says &quot;Hello World&quot; and the other says &quot;Goodbye World&quot;.</p>
  <p>I want to match on the word &quot;Hello&quot; and return the <code>_id</code> only for fields containing &quot;Hello&quot;. The expected result is:</p>
  <pre><code>1
  55
  </code></pre>
  <p>The closest I could come in my attempt was:</p>
  <pre><code>jq -nr --stream '
  fromstream(1|truncate_stream(inputs))
  | select(.body %like% &quot;Hello&quot;)
  | ._id
  ' &lt;input_file
  </code></pre>