| 1674 | |
| 1675 | @property |
| 1676 | def _cursor_args(self): |
| 1677 | fields_name = "projection" |
| 1678 | # snapshot is not handled at all by PyMongo 3+ |
| 1679 | # TODO: evaluate similar possibilities using modifiers |
| 1680 | if self._snapshot: |
| 1681 | msg = "The snapshot option is not anymore available with PyMongo 3+" |
| 1682 | warnings.warn(msg, DeprecationWarning) |
| 1683 | |
| 1684 | cursor_args = {} |
| 1685 | if not self._timeout: |
| 1686 | cursor_args["no_cursor_timeout"] = True |
| 1687 | |
| 1688 | if self._allow_disk_use: |
| 1689 | cursor_args["allow_disk_use"] = True |
| 1690 | |
| 1691 | if self._loaded_fields: |
| 1692 | cursor_args[fields_name] = self._loaded_fields.as_dict() |
| 1693 | |
| 1694 | if self._search_text: |
| 1695 | if fields_name not in cursor_args: |
| 1696 | cursor_args[fields_name] = {} |
| 1697 | |
| 1698 | if self._search_text_score: |
| 1699 | cursor_args[fields_name]["_text_score"] = {"$meta": "textScore"} |
| 1700 | |
| 1701 | return cursor_args |
| 1702 | |
| 1703 | @property |
| 1704 | def _cursor(self): |