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

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

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