From b7d0d8f0ccf60c417f3b49da91e6fefb2da3bc3f Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Mon, 5 Mar 2012 11:20:22 +0000 Subject: [PATCH] Added warning to SortedListField --- mongoengine/fields.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mongoengine/fields.py b/mongoengine/fields.py index 33b0ed5b..14fcca01 100644 --- a/mongoengine/fields.py +++ b/mongoengine/fields.py @@ -508,6 +508,12 @@ class SortedListField(ListField): the database in order to ensure that a sorted list is always retrieved. + .. warning:: + There is a potential race condition when handling lists. If you set / + save the whole list then other processes trying to save the whole list + as well could overwrite changes. The safest way to append to a list is + to perform a push operation. + .. versionadded:: 0.4 .. versionchanged:: 0.6 - added reverse keyword """