mogodb排序

db.getClloection('user').find().sort({'age':-1}).pretty()

2.自然排序,也就是插入的先后顺序

db.getClloection('user').find().sort({'$natural':-1})

 

posted @ 2018-05-15 08:30  江山一族  阅读(135)  评论(0编辑  收藏  举报