diff --git a/mongoengine/queryset.py b/mongoengine/queryset.py index 551a961d..f5c1cdd1 100644 --- a/mongoengine/queryset.py +++ b/mongoengine/queryset.py @@ -104,9 +104,10 @@ class QuerySet(object): def first(self): """Retrieve the first object matching the query. """ - result = self._collection.find_one(self._query) - if result is not None: - result = self._document._from_son(result) + try: + result = self[0] + except IndexError: + result = None return result def with_id(self, object_id):