From eb54037b66ef66429f9027d9a747d1bff12a3256 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Wed, 9 May 2012 12:08:00 +0100 Subject: [PATCH] Added note that get_or_create contains a race condition Refs #478 --- mongoengine/queryset.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mongoengine/queryset.py b/mongoengine/queryset.py index 150cfc4e..dc5bb808 100644 --- a/mongoengine/queryset.py +++ b/mongoengine/queryset.py @@ -793,6 +793,9 @@ class QuerySet(object): dictionary of default values for the new document may be provided as a keyword argument called :attr:`defaults`. + .. note:: This requires two separate operations and therefore a + potential race condition exists. + :param write_options: optional extra keyword arguments used if we have to create a new document. Passes any write_options onto :meth:`~mongoengine.Document.save`