相关疑难解决方法(0)

如何从现有集合为 mongoengine 文档生成模型

mongo 中有一个现有的集合,称为students. 有没有办法让我不必为所有字段键入架构并直接从集合中导入所有字段?

class Student(DynamicDocument):
    meta = {'collection': 'students'}
    name = StringField() # I want to avoid writing this for all the fields in the collection
    rollNo = IntField()
    address = StringField()
Run Code Online (Sandbox Code Playgroud)

python collections document mongoengine

8
推荐指数
2
解决办法
788
查看次数

标签 统计

collections ×1

document ×1

mongoengine ×1

python ×1