模糊查询(示例中:db.student.find前缀
和 find对应的()
省略)html
|------|----------------------|---------------------------------| | 说明 | 示例 | mysql语句对比 | | 等值 | {"name":"张三"} | where name = '张三' | | 模糊 | {title:/驾驶机动车/} | where title regexp ‘驾驶机动车’ |mysql
数组查询sql
db.student.find({ pictures: { $exists: true, $not: {$size: 0} } })
模糊查询mongodb
db.student.find({"title":/驾驶机动车/}) db.student.find({"title":{$regex:/驾驶机动车/}})
菜鸟教程数组