Add support for cursor.comment (#1420)

This commit is contained in:
Stefan Wójcik
2016-12-04 00:33:42 -05:00
committed by GitHub
parent 8391af026c
commit 0007535a46
2 changed files with 23 additions and 1 deletions

View File

@@ -933,6 +933,14 @@ class BaseQuerySet(object):
queryset._ordering = queryset._get_order_by(keys)
return queryset
def comment(self, text):
"""Add a comment to the query.
See https://docs.mongodb.com/manual/reference/method/cursor.comment/#cursor.comment
for details.
"""
return self._chainable_method("comment", text)
def explain(self, format=False):
"""Return an explain plan record for the
:class:`~mongoengine.queryset.QuerySet`\ 's cursor.