[Answer]-Django Mongoengine concurrent saves are failing

1👍

Saves in mongoengine are atomic, however, when saving a list it does it as a $set for the whole list. So you could have a race condition.

This is why the preferred way to append to a list is to do a $push eg:

modelObj.update(push__dataList=data)
👤Ross

0👍

table_name.objects.filter(__id=1).update(push__fieldname={‘key’ : ‘value’,’key’ : ‘value’,}) if you want delete than pull

Leave a comment