At first, db.users.find(...).map() did not work, because db.users.find(...) does not return a real array to you.
So you need to convert to an array first.
db.users.find(...).toArray()
Then, if you use the map () function, it will work
db.users.find(...).toArray().map( function(u) { return u.text ; } )
Another simple trick is to use .forEach ()
It will do the trick
var cursor = db.users.find(...);
source share