flask mongoengine mapping objects code example
Example: flask mongoengine mapping objects
'''
1. Configuration
2. Mapping Objects
* flask mongoengine step 2
-To declare a model that represents a Mongo document,
create a class that inherits from Document and declare
each of the fields.'''
import mongoengine as me
class Movie(me.Document):
title = me.StringField(required=True)
year = me.IntField()
rated = me.StringField()
director = me.StringField()
actors = me.ListField()