MongoDb常用语法整理

1. 大于 $gt

db.collection.find({ “field” : { $gt: value } } );

2. 小于 $lt

db.collection.find({ “field” : { $lt: value } } );

3. 大于或等于$gte

db.collection.find({ “field” : { $gte: value } } );

4. 小于或等于$lte

db.collection.find({ “field” : { $lte: value } } );

5. 不等于 $ne

db.collection.find( { “field” : { $ne : value } } );

© 版权声明

☆ END ☆
喜欢就点个赞吧
点赞0 分享
图片正在生成中,请稍后...