MongoEngine Manipulates MongoDB How Atomically Append Data to a List?

  mongodb, question

R.T.
That is, if there is a doc

{
 “id”: 1,
 "list": [1,2,3]
 }

If you add an element to the list4In the case of possible concurrency, ensure the safety of the insertion?

{$addToSet:{list:4}}