mongodb查询某个字段数据

如下

db.集合名.find( {}, {需要查询的字段:1, _id:0} )

例如

db.userInfo.find({}, {'created_at':1, _id: 0})

默认会显示 _id

1 表示显示此字段

0 表示不显示此字段

原文地址:https://www.cnblogs.com/niuben/p/14809413.html