首页   /   DB   /   Mongo cmd

内容

查询条件,显示字段

{Find}   =  {activityID:194 , roleID:15728645}
{Fields} =  {activityInfo:"" , roleID:"" }

robomogodb操作

db.getCollection('records').find({customPresentOffset:{$ne:0}},{customPresentOffset:1})
// 查字段,不等于0,且只显示这个字段
db.getCollection('records').find({},{customPresentOffset:1,roleID:1,customPresentOffset_New:1})
// 只显示表中的三个字段