Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Changes in 1.0.0
- Fix use of $geoNear or $collStats in aggregate #2493
- BREAKING CHANGE: Further to the deprecation warning, remove ability to use an unpacked list to `Queryset.aggregate(*pipeline)`, a plain list must be provided instead `Queryset.aggregate(pipeline)`, as it's closer to pymongo interface
- BREAKING CHANGE: Further to the deprecation warning, remove `full_response` from `QuerySet.modify` as it wasn't supported with Pymongo 3+
- BREAKING CHANGE: Remove deprecated ``QuerySet.snapshot``, which had no effect with PyMongo 3+. Remove calls to ``.snapshot(...)``; there is no direct replacement.
- BREAKING CHANGE: Remove the deprecated ``Q.empty`` and ``QNode.empty`` properties. Use ``not query`` instead (or ``bool(query)`` for the inverse). #2919
- Fixed stacklevel of many warnings (to point places emitting the warning more accurately)
- Add support for collation/hint/comment to delete/update and aggregate #2842
Expand Down
20 changes: 0 additions & 20 deletions mongoengine/queryset/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def __init__(self, document, collection):
self._where_clause = None
self._loaded_fields = QueryFieldList()
self._ordering = None
self._snapshot = False
self._timeout = True
self._allow_disk_use = False
self._read_preference = None
Expand Down Expand Up @@ -857,7 +856,6 @@ def _clone_into(self, new_qs):
"_where_clause",
"_loaded_fields",
"_ordering",
"_snapshot",
"_timeout",
"_allow_disk_use",
"_read_preference",
Expand Down Expand Up @@ -1228,18 +1226,6 @@ def explain(self):
"""
return self._cursor.explain()

# DEPRECATED. Has no more impact on PyMongo 3+
def snapshot(self, enabled):
"""Enable or disable snapshot mode when querying.

:param enabled: whether or not snapshot mode is enabled
"""
msg = "snapshot is deprecated as it has no impact when using PyMongo 3+."
warnings.warn(msg, DeprecationWarning, stacklevel=2)
queryset = self.clone()
queryset._snapshot = enabled
return queryset

def allow_disk_use(self, enabled):
"""Enable or disable the use of temporary files on disk while processing a blocking sort operation.
(To store data exceeding the 100 megabyte system memory limit)
Expand Down Expand Up @@ -1726,12 +1712,6 @@ def _collection(self):
@property
def _cursor_args(self):
fields_name = "projection"
# snapshot is not handled at all by PyMongo 3+
# TODO: evaluate similar possibilities using modifiers
if self._snapshot:
msg = "The snapshot option is not anymore available with PyMongo 3+"
warnings.warn(msg, DeprecationWarning, stacklevel=3)

cursor_args = {}
if not self._timeout:
cursor_args["no_cursor_timeout"] = True
Expand Down