Once content is added the name of the collection is defaulted to the name of the class. Is it possible to specify the collection name or is my approach wrong? Using the code I have my collection is then named "mongo_engine_python" by default.
from mongoengine import *
try:
connect(
db='MongoEngine_Test',
host="mongodb://localhost:27017/"
)
print("Connection successful")
except:
print("Unable to connnect")
class MongoEnginePython(Document):
item_name = StringField(max_length=200, required=True)
item_price = IntField(default=0)