Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
让我们说
db = MongoEngine(app) class User(db.Document): uid = db.SequenceField() uname = db.StringField() user = User.objects
我不太了解mongodb,但是这样的事情可能吗?:
specific_user = user[uid]
关闭,但给你:
specific_user = user.find_one({"uid": uid})
您可以在此处阅读有关在 Pymongo 中查询对象的更多信息