node.js - Fetching fields which have values as array in mongodb -
my collection looks this
{a:"foo", b:[10,20,30]} {a:"boo", b:[15,25,35]} {a:"abc", b:[10,40,50]} {a:"xyz", b:[10,60,70]}
now, want retrieve entire array under a:"foo". how do this?
db.collection.find({"a":"foo"})
will return object matching criteria , can access "b" element of results
Comments
Post a Comment