Deep picking using Underscore.JS
<p>I am trying to use underscoreJs to manipulate a JavaScript object and having problems doing so.</p>

<p>Here is my example </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var data = {
  "label": "SomeName",
  "parent": [{
    "id": "parentId",
    "resources": [{
      "name": "ID1NAME",
      "calls": [
        "user_get", "user2_post", "user3_delete"
      ]
    }, {
      "name": "ID2",
      "calls": [
        "employee1_get", "employee2_delete", "employee3_update"
      ]
    }]
  }]
};
var res = _(data).chain().
    pluck('parent').
    flatten().
    findWhere(function(item){
     item === "user_get"
    }).
    value();
    
console.log(res);</code></pre>
</div>
</div>
</p>

<p>Using an element which is a part of <code>data.parent.calls[]</code> (example : "user_get") I would like to extract its parent object, i.e. <code>data.parent[0]</code>. </p>

<p>I tried above but always get undefined. I appreciate any help on this.</p>