title: Get parent array key in deep nested object using lodash
body: <p>I'm using Lodash JavaScript library in my project and have a problem in getting the parent array key object filtered object:</p>
  
  <p>I've the following data:</p>
  
  <pre><code>var data = {
   5: [{
    id: "3",
    label: "Manish"
   }, {
    id: "6",
    label: "Rahul"
   }, {
    id: "7",
    label: "Vikash"
   }],
   8: [{
    id: "16",
    label: "Pankaj"
   }, {
    id: "45",
    label: "Akash"
   }],
   9: [{
    id: "15",
    label: "Sunil"
   }]
  }
  </code></pre>
  
  <p>My requirement is if I've the array of <code>[6,16]</code> then I want a new result array containing values <code>5,8</code> because these two array keys have objects which contain <code>id:"6" and id:"16"</code></p>
  
  <p>I tried it using _.flatten and _.pick method but could not work. I used the following code;</p>
  
  <pre><code>var list = [];
  _.each(data, function(item){
      list.push(_.omit(item, 'id'));
      list.push(_.flatten(_.pick(item, 'id')));
  });
  var result = _.flatten(list);
  console.log(result);
  </code></pre>