摘要: 元素 操作符 $exists 匹配具有指定字段的文档 // mongodb 数据 [ {price: 1, name: 'xx 1', message: 'message 1'}, {price: 2, name: 'xx 2', message: null}, {name: 'xx 3', mes 阅读全文
posted @ 2020-09-17 11:25 渡心° 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 逻辑操作符 $and 并且 用逻辑联接查询子句and返回与两个子句条件都匹配的所有文档。 col.find({$and: [{ price: { $eq: 1 } },{ category: { $eq: '水果' } }] }) // 返回 price 1 并且 category '水果' 的数据 阅读全文
posted @ 2020-09-17 10:29 渡心° 阅读(184) 评论(0) 推荐(0) 编辑