meteor-feature-requests icon indicating copy to clipboard operation
meteor-feature-requests copied to clipboard

Collation support for find/findOne

Open turbobuilt opened this issue 8 years ago • 2 comments

Mongodb 3.4 allows the use of collations. This is a huge development they should have done long ago. Meteor should support should be implemented ASAP. It also should be easy to do. Basically this is all that is needed: updating find and findOne to support the collation argument.

In raw mongodb you do collection.find({query}).collation({ locale: "en", strength: 2 });

In meteor it should be collection.find({query},{collation:{ locale: "en", strength: 2 }});

turbobuilt avatar Jun 21 '17 16:06 turbobuilt

Would this be needed in minimongo also? if so I believe it might be a bigger challenge.

zimme avatar Jun 23 '17 09:06 zimme

Well not really because I can always just do a custom sort on the client side once I get the data. However on the server a core modification is needed because it's about interacting with the database.

In the mean time I realized that you can create new collections with a default collation for now that will be used automatically.

I found out that, unfortunately, the new collations don't support regexes like /^firstna/i, so they are not as functional yet as I had hoped.

turbobuilt avatar Jun 23 '17 17:06 turbobuilt