标签: python python-2.7 pymongo flask-mongoengine pymongo-2.x
让我们说
db = MongoEngine(app) class User(db.Document): uid = db.SequenceField() uname = db.StringField() user = User.objects
我不太了解mongodb,但是这样可能吗?:
specific_user = user[uid]
答案 0 :(得分:1)
关闭,但是你走了:
specific_user = user.find_one({"uid": uid})
您可以阅读有关在Pymongo here