您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页mongodb 常用不好写命令整理

mongodb 常用不好写命令整理

来源:二三娱乐
  • 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})

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务