MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / min

Method min

pymongo/synchronous/cursor.py:666–686  ·  view source on GitHub ↗

Adds ``min`` operator that specifies lower bound for specific index. When using ``min``, :meth:`~hint` should also be configured to ensure the query uses the expected index and starting in MongoDB 4.2 :meth:`~hint` will be required. :param spec: a list of field, lim

(self, spec: _Sort)

Source from the content-addressed store, hash-verified

664 return self
665
666 def min(self, spec: _Sort) -> Cursor[_DocumentType]:
667 """Adds ``min`` operator that specifies lower bound for specific index.
668
669 When using ``min``, :meth:`~hint` should also be configured to ensure
670 the query uses the expected index and starting in MongoDB 4.2
671 :meth:`~hint` will be required.
672
673 :param spec: a list of field, limit pairs specifying the inclusive
674 lower bound for all keys of a specific index in order.
675
676 .. versionchanged:: 3.8
677 Deprecated cursors that use ``min`` without a :meth:`~hint`.
678
679 .. versionadded:: 2.7
680 """
681 if not isinstance(spec, (list, tuple)):
682 raise TypeError(f"spec must be an instance of list or tuple, not {type(spec)}")
683
684 self._check_okay_to_chain()
685 self._min = dict(spec)
686 return self
687
688 def sort(
689 self, key_or_list: _Hint, direction: Optional[Union[int, str]] = None

Callers 11

findMethod · 0.45
test_minMethod · 0.45
test_cloneMethod · 0.45
findMethod · 0.45
test_minMethod · 0.45
test_cloneMethod · 0.45
add_sidebar_buttonFunction · 0.45
scroll_sidebarFunction · 0.45
from_vectorMethod · 0.45

Calls 1

_check_okay_to_chainMethod · 0.95

Tested by 8

findMethod · 0.36
test_minMethod · 0.36
test_cloneMethod · 0.36
findMethod · 0.36
test_minMethod · 0.36
test_cloneMethod · 0.36