Здравствуйте.
Есть три таблицы
class UserCalendarLayer(mongoengine.EmbeddedDocument):
i_id = mongoengine.ObjectIdField(default=ObjectId)
id = mongoengine.StringField()
summary = mongoengine.StringField()
time_zone = mongoengine.StringField()
background_color = mongoengine.StringField()
foreground_color = mongoengine.StringField()
access_role = mongoengine.StringField()
primary = mongoengine.StringField(default="False")
is_active = mongoengine.StringField(default='True')
class UserCalendar(mongoengine.EmbeddedDocument):
i_id = mongoengine.ObjectIdField(default=ObjectId)
provider = mongoengine.StringField()
name = mongoengine.StringField(default='primary') #"primary"
access_data = mongoengine.DictField()
is_active = mongoengine.StringField(default='True')
email = mongoengine.StringField()
calendars_layer = mongoengine.ListField(mongoengine.EmbeddedDocumentField(UserCalendarLayer))#, default=UserCalendarLayer))
class User(mongoengine.Document, UserMixin):
user_id = mongoengine.StringField()
first_name = mongoengine.StringField()
last_name = mongoengine.StringField()
contacts = mongoengine.ListField(mongoengine.EmbeddedDocumentField(UserContact))
calendars = mongoengine.ListField(mongoengine.EmbeddedDocumentField(UserCalendar))
Мне нужно сделать запрос на обновление данных в модели UserCalendarLayer, у меня есть i_id нужной записи.
Как сделать запрос при помощи mongo или mongoenginge?
Проект делаю на falsk.