I have set up the following model in MongoDB using MongoEngine.
class Category(Document):
normed_name = StringField(),
name = StringField(),
path = StringField(),
The model was different initially and I did import some documents, but I have deleted all old databases and changed the model to the above.
When I then run the following python script:
import model
from mongoengine import connect
uri = 'mongodb://<user>:<pass>@<me>.mlab.com:<port>/cost_database'
connect('cost_database', host = uri)
test = model.Category()
test.name = 'test'
print(test.name)
test.save(validate=False)
The script outputs,
test
But in the database the following file is created:
{
"_id": {
"$oid": "5a61e64dc645177b50d0d656"
}
}
Any idea on why name wasn't saved?