我有一个MongoEngine文档班的学生。。
class Student(Document):
db_id = StringField()
name = StringField()
score = IntField()
deleted = BooleanField(default=False, required=True)
我想以]查询>
Student.objects.filter(score__gte = 30)
但是我遇到类似AttributeError:'int'对象没有属性'get'
]的错误>有人可以帮我这个忙吗?谢谢!
我有一个MongoEngine文档类Student ..类Student(Document):db_id = StringField()名称= StringField()分数= IntField()已删除= BooleanField(默认= False,必填= ...
from mongoengine import *
connect()
class Student(Document):
name = StringField()
score = IntField()
Student(name='Bob', score=35).save()
print(Student.objects(score__gte=30))
# output: [<Student: Student object>]