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

Method collation

mongoengine/queryset/base.py:936–960  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 2

_cursorMethod · 0.80
test_collationMethod · 0.80

Calls 1

cloneMethod · 0.95

Tested by 1

test_collationMethod · 0.64