$query = '{ "$and": [
               {"$or": [{"reported": {"$exists": false}}, {"reported": 0}]},
               {"$or": [{"hidden": {"$exists": false}}, {"hidden":1}]}
         ]
         ,"_id":1081
      }';db->Post->find($query);


该语句的查询意思是: 查找Post 文档 _id 为 1081 且 reported 字段不存在 或者 reported 字段为 0 或者 hidden 字段不存在 或者 hidden 字段为 0 的数据
Tags:
Mongodb | 评论(0) | 引用(0) | 阅读(5347)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]