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)
| 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 |