mongo-swift-driver icon indicating copy to clipboard operation
mongo-swift-driver copied to clipboard

SWIFT-1616 ⁃ Impossible to create a text index with default name

Open valeriomazzeo opened this issue 2 years ago • 0 comments

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?

valeriomazzeo avatar Jul 29 '22 11:07 valeriomazzeo