摘要: db.getCollections('students').update({},{$set:{}},{upsert:false,multi:false}) 更新单行,upsert为true时,更新不存在的数据,即为添加数据 db.getCollections('students').update({ 阅读全文
posted @ 2018-05-15 23:36 江山一族 阅读(149) 评论(0) 推荐(0) 编辑
摘要: db.getClloection('user').find().sort({'age':-1}).pretty() 2.自然排序,也就是插入的先后顺序 db.getClloection('user').find().sort({'$natural':-1}) 阅读全文
posted @ 2018-05-15 08:30 江山一族 阅读(135) 评论(0) 推荐(0) 编辑