diff --git a/docs/changelog.rst b/docs/changelog.rst index 66336591f..8c8526192 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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 diff --git a/mongoengine/queryset/base.py b/mongoengine/queryset/base.py index 0242d92e0..e29b64a28 100644 --- a/mongoengine/queryset/base.py +++ b/mongoengine/queryset/base.py @@ -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 @@ -857,7 +856,6 @@ def _clone_into(self, new_qs): "_where_clause", "_loaded_fields", "_ordering", - "_snapshot", "_timeout", "_allow_disk_use", "_read_preference", @@ -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) @@ -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