0

There is db structure were the value is array of objects like

{
 key : [
  {
   retrive : false
  },
  {
   retrive : true
  }
 ]
}

And i want to query only the objects were 'retrieve' key is set to true.

Beast
  • 617
  • 2
  • 8
  • 19
  • All right i found about the $elemMatch operator which does what i want, but it is said that it only retrieves the first document matches but what i want is like multiple $elemMatch – Beast Jul 31 '13 at 09:45

1 Answers1

0
  db.collection.find({'key.$.retrive':true},function(err,res){


   });
sachin
  • 13,605
  • 14
  • 42
  • 55