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

Popular posts from this blog

json - Zend error Connection -

javascript - Trigger mouseenter when an animated element touches mouse -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -