Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. :param collation: `~pymongo.collation.Collation` or dict with following fields: { locale: str,
(self, collation=None)
| 934 | return queryset |
| 935 | |
| 936 | def collation(self, collation=None): |
| 937 | """ |
| 938 | Collation allows users to specify language-specific rules for string |
| 939 | comparison, such as rules for lettercase and accent marks. |
| 940 | :param collation: `~pymongo.collation.Collation` or dict with |
| 941 | following fields: |
| 942 | { |
| 943 | locale: str, |
| 944 | caseLevel: bool, |
| 945 | caseFirst: str, |
| 946 | strength: int, |
| 947 | numericOrdering: bool, |
| 948 | alternate: str, |
| 949 | maxVariable: str, |
| 950 | backwards: str |
| 951 | } |
| 952 | Collation should be added to indexes like in test example |
| 953 | """ |
| 954 | queryset = self.clone() |
| 955 | queryset._collation = collation |
| 956 | |
| 957 | if queryset._cursor_obj: |
| 958 | queryset._cursor_obj.collation(collation) |
| 959 | |
| 960 | return queryset |
| 961 | |
| 962 | def batch_size(self, size): |
| 963 | """Limit the number of documents returned in a single batch (each |