How atomic are mongoengine's operations
问题 I'm trying to transition between object's state like so: User.objects(id=user_id, state=STATE_WAITING).update_one(set__state=STATE_FINISHED) The question is, can there be a situation where two processes will make the same operation asynchronously and succeed? If so, can this operation be atomic, so the next process that will try to update the user (at the same time asynchronously), will fail because it's status will be already "finished"? 回答1: When writing on a single document, the operation