zhengyyao

导航

mongo 查询sql

1. 模糊查询

db.city.find({"region":/^new/})   #region字段以new字符串开始的记录

2. 大小比较

db.collection.find({ "field" : { $gt: value } } ); // greater than : field > value
db.collection.find({ "field" : { $lt: value } } ); // less than : field < value
db.collection.find({ "field" : { $gte: value } } ); // greater than or equal to : field >= value
db.collection.find({ "field" : { $lte: value } } ); // less than or equal to : field <= value

 

posted on 2017-11-29 16:45  zhengyyao  阅读(191)  评论(0)    收藏  举报