- select * from db.co order by id DESC limit 5
db.co.find().limit(5).sort({"_id":-1})
- find some items not exists in collection:
db.co.find({ "item":
{ "$exists" : False }
})
- skip
db.co.find().skip(5).limit(5)
- delete from db.co where age < 30
db.co.remove({ 'age' : {$lt : 30}})
- select age from db.co
db.co.find({},{"age" : 1})
- select others(not age) from db.co
db.co.find({},{"age" : 0})
网友评论