Create unique index with multiple fields
JohnCoates opened this issue · comments
Is your feature request related to a problem? Please describe.
Is it currently possible to build a unique index with multiple fields? I looked at the following code but it didn't look like I could do that.
MongoKitten/Sources/Meow/Indexes.swift
Lines 27 to 33 in c82d7be
Describe the solution you'd like
Would be great to add a unique index with multiple fields.
Describe alternatives you've considered
None.
Additional context
N/A
Hey, thanks for highlighting this! MongoKitten 7 has a couple of helpers already, but I don't think I'll add overrides for each and every possible scenario. However, I propose adding an override on SortedIndex
that accepts multiple fields, which you can then mark as unique using the .unique()
function on that index.
That sounds like a good solution.
fixed in 7.2.14