I am having strange situation – creating some Mongoengine object from Django shell is successful, but creating the same object from Django view looks like successful but without any data appeared in MongoDB. I.e. the same code like that –
from myapp.mongomodels import MyModel
m = MyModel(a=1, b=2, c=3)
m.save()
produces new object inserted into MongoDB when running from manage.py shell, and produces nothing when running from Django view. I have traced the code and I am seeing mongoengine.Document.save() method is running correctly without any exceptions.
Looks like I’ve missed something obvious.
Will be grateful for any help.
You should be able to do that but force the save using: