MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / count

Method count

mongoengine/queryset/queryset.py:135–149  ·  view source on GitHub ↗

Count the selected elements in the query. :param with_limit_and_skip (optional): take any :meth:`limit` or :meth:`skip` that has been applied to this cursor into account when getting the count

(self, with_limit_and_skip=False)

Source from the content-addressed store, hash-verified

133 self._has_more = False
134
135 def count(self, with_limit_and_skip=False):
136 """Count the selected elements in the query.
137
138 :param with_limit_and_skip (optional): take any :meth:`limit` or
139 :meth:`skip` that has been applied to this cursor into account when
140 getting the count
141 """
142 if with_limit_and_skip is False:
143 return super().count(with_limit_and_skip)
144
145 if self._len is None:
146 # cache the length
147 self._len = super().count(with_limit_and_skip)
148
149 return self._len
150
151 def no_cache(self):
152 """Convert to a non-caching queryset"""

Callers 15

count_documentsFunction · 0.45
test_no_sub_classesMethod · 0.45
test_q_with_dbrefMethod · 0.45
test_q_cloneMethod · 0.45
test_qMethod · 0.45
test_q_listsMethod · 0.45

Calls

no outgoing calls