Pymongo: TypeError: if no direction is specified, key_or_list must be an instance of list
来源:互联网 发布:如何更新mac os系统 编辑:程序博客网 时间:2024/06/10 01:12
使用pymongo对某一字段进行sort时,报错
TypeError: if no direction is specified, key_or_list must be an instance of list
问题代码:
items = db.symptomAssociation.find({ 'result.pre.0':{'$regex':input_text}}).sort({'result.0.confidence':-1})
更正后:
items = db.symptomAssociation.find({ 'result.pre.0':{'$regex':input_text}}).sort([('result.0.confidence',-1)])
2 1
- Pymongo: TypeError: if no direction is specified, key_or_list must be an instance of list
- TypeError: super(type, obj): obj must be an instance or subtype of type
- - No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing in
- <java>No enclosing instance of type GraphicFrame is accessible. Must qualify the allocation with an
- No enclosing instance of type A is accessible. Must qualify the allocation with an enclosin
- No enclosing instance of type Monster is accessible. Must qualify the allocation with an enclosing i
- No enclosing instance of type E is accessible. Must qualify the allocation with an en
- No enclosing instance of type ChuangKou is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type UpdataInfoParser is accessible. Must qualify the allocation with an en
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- Java出现No enclosing instance of type ImageViewer is accessible. Must qualify the allocation with an
- [Error]No enclosing instance of type XX is accessible. Must qualify the allocation with an e
- No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instanc
- jdbc插入大量数据时优化处理-最近遇到的解决我一大难题
- 多些时间能少写些代码
- MySQL与Oracle 差异比较之函数
- Android中的Application类
- KVC与KVO
- Pymongo: TypeError: if no direction is specified, key_or_list must be an instance of list
- 高通平台手机开发之Bring-up
- 多线程编程
- Kafka+Storm+HDFS整合实践
- Android ContentProvider和Uri
- Android主界面tab导航栏的实现
- 栈和堆的数据结构的差异
- 图书管理系统 C语言
- Java操作FTP(2)