mongodb - Query mongo document to return all rows in a field -
for example, if have name field in mongo document person. in sql, query select name person; return names. equivalent in mongo?
i thinking db.person.find(<<what fill here>>, {name: 1});
i trying retrieve names while using mongo console.
an empty json object {} matches documents.
db.person.find({}, {name: 1});
Comments
Post a Comment