在mongodb中我们的对sort的写法是 db.xxx.find().sort({'date':1})
在pycharm中这样写会报错:
TypeError: if no direction is specified, key_or_list must be an instance of list
正确的脚本是,db.xxx.find().sort([('date',1)])
在mongodb中我们的对sort的写法是 db.xxx.find().sort({'date':1})
在pycharm中这样写会报错:
TypeError: if no direction is specified, key_or_list must be an instance of list
正确的脚本是,db.xxx.find().sort([('date',1)])