我正在使用 pymongo 驱动程序。
有人可以看看 pymongo 并告诉我如何做大于吗?我习惯于:为所有事情做。
最佳答案
你见过the doc ?从手册中获取:
>>> d = datetime.datetime(2009, 11, 12, 12)
>>> for post in posts.find({"date": {"$lt": d}}).sort("author"):
... post
...
{u'date': datetime.datetime(2009, 11, 10, 10, 45), u'text': u'and pretty easy too!', u'_id': ObjectId('...'), u'author': u'Eliot', u'title': u'MongoDB is fun'}
{u'date': datetime.datetime(2009, 11, 12, 11, 14), u'text': u'Another post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'bulk', u'insert']}
关于python - 我如何做大于/小于使用 MongoDB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4791555/