I'm new to MongoDB and MongoEngine and currently my documents are of below type :
[
{
"Question1": "How do you rate the whole restaurant",
"Rating": [
"Poor",
"Average",
"Good"
],
"next": [
{
"Question2": "How do you rate food plates cleanness",
"Rating": [
"Poor",
"Average",
"Good"
]
},
{
"Question3": "How do you rate floor cleanness",
"Rating": [
"Poor",
"Average",
"Good"
]
}
]
},
{
"Question4": "How do you rate food taste",
"Rating": [
"Poor",
"Average",
"Good"
]
}
]
I'm thinking to create models in below manner in mongoengine:
class Ratings(db.EmbeddedDocument):
Rating = db.ListField()
class Questions(db.EmbeddedDocument):
Question = db.StringField()
rating_type = db.EmbeddedDocumentField(Ratings)
class FeedbackFormTemplate(db.Document):
pass
The above classes (Questions and Ratings) will be used to create questions and ratings.
I want to use the class: FeedbackFormTemplate to create the documents. But I'm not getting any ideas on building the models.
Any help on this is much appreciated.