到目前为止,这是我的代码:
from pymongo import MongoClient
client = MongoClient()
client = MongoClient('localhost', 27017)
db = client.local
collection = db.orderbook_update
orderbook = collection.find({
"lastUpdated": {"$lt": ts}
}).sort("position",pymongo.DESCENDING).limit(1)
print(orderbook)当我这样做时,我的打印(订单)告诉我:<pymongo.cursor.Cursor object at 0x7ff7defef828>,我如何能够打印我的结果以便使用它?我的数据库中的json文件有三个主要组件: lastUpdated、问询、投标。谢谢!
发布于 2018-12-20 09:29:59
order = list(orderbook)注意:一旦执行此操作,游标对象将不可用
https://stackoverflow.com/questions/53865107
复制相似问题