After applying the find operation in mongodb.. i get the following list of documents..
db.users.find(....)
i got:
{ "text" : "Hey" }
{ "text" : "Hi" }
{ "text" : "Hello" }
{ "text" : "yes" }
How can i convert it into
["Hey","Hi","Hello","yes"].
i tried
db.users.find(...).map( function(u) { return "u.text"; } )
but it is giving error!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…