mongo-swift-driver
mongo-swift-driver copied to clipboard
SWIFT-1616 ⁃ Impossible to create a text index with default name
Describe the bug
When attempting to create a text index with name=nil, the driver crashes on this line because of the assumption that the value (v), must be an Int.
While that's true for ascending (1) and descending (-1) indexes, that's not the case for text, 2dsphere and other type of indexes.
The IndexModel is specified like this:
IndexModel(keys: ["fieldname": "text"] ...
Is there another way to create these kind of indexes? Or, is this just a bug in the driver?