Answer the question
In order to leave comments, you need to log in
How to update data in EmbeddedDocument mongoDB?
Hello.
There are three tables
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))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question