As of server version 3.4 (max wire version 5), a collation option is supported for some commands. Helpers for the following commands therefore must be updated:
- create
- createIndexes
- aggregate
- count
- distinct
- find (command only)
- findAndModify
- geoNear
- group
- mapReduce
- remove (command)
- update (command)
The follow CRUD API methods are thus affected. Supporting a collation option for these methods is required:
- count
- distinct
- find
- deleteOne
- deleteMany
- findOneAndDelete
- findOneAndReplace
- findOneAndUpdate
- replaceOne
- updateMany
- updateOne
Support defining an index as a key pattern
Creating an index, dropping an index, and providing an index hint will support collations defined as documents.
Note about bulk writes
Given the definition of a Bulk Write Model as a document in the form:
{ updateOne: { filter: {..}, update: {...} } }
or
{ deleteOne: { filter: {..} } }
etc., a collation can be defined for each bulk write model as in the following example:
db.collection.bulkWrite([ {updateOne: {..., collation: {...}}}, {updateMany: {..., collation: {...}}}, {replaceOne: {..., collation: {...}}}, {deleteOne: {..., collation: {...}}}, {deleteMany: {..., collation: {...}}} ]);
The driver must not automatically add a collation to any of the Bulk Write Models; the user must explicitly provide the collation to each.
- depends on
-
CDRIVER-1372 Support providing collation per operation
- Closed
-
CSHARP-1706 Support providing collation per operation
- Closed
-
CXX-970 Support collation per collection & operation
- Closed
-
CXX-971 Support providing collation per operation
- Closed
-
JAVA-2241 Support collation
- Closed
-
NODE-754 Support providing collation per operation
- Closed
-
PHPC-734 Support providing collation per operation
- Closed
-
PHPLIB-205 Support providing collation per operation
- Closed
-
PYTHON-1113 Support collation per operation
- Closed
-
RUBY-1126 Support providing collation per operation
- Closed
-
RUST-34 Support providing collation per operation
- Closed
-
SERVER-1920 Sort by collation
- Closed
- is related to
-
SERVER-24239 Add support for building indices with the same key pattern but different collations
- Closed