pymongo排序

import pymongo
#以Account集合为例
db.Account.find().sort("UserName")  
db.Account.find().sort("UserName",pymongo.ASCENDING)   
db.Account.find().sort("UserName",pymongo.DESCENDING)  
db.Account.find().sort([("UserName",pymongo.ASCENDING),("Email",pymongo.DESCENDING)])

 

posted @ 2018-12-22 17:33  yudis  阅读(185)  评论(0编辑  收藏  举报