MongoDB small features, like Collations

Parse is so powerful also because it’s coupled with MongoDB.
I know supporting every Mongo feature is impossible, but case-insensitivity is important.
When read preference was added, it was huge for me.

I know I can always use the Config object to find the “native” collection, but Parse.Query is so simple.

Or maybe it’s just a matter of officially supporting Config . idk

I’m not very clear, but you get the idea :slight_smile:

Olivier Allouch

The MongoDB storage adapter of Parse Server already has a caseInsensitive option to add a specific collation for case insensitivity to the find query, specifically it sets { locale: 'en_US', strength: 2 }.

Is that what you are looking for?

If you want to propose exposing exposing more/all of MongoDB’s native collation options, I suggest you open an issue in Parse Server and reference this thread here to make a feature request.

This is the issue :

It’s about custom collations (not only english) in Parse.Query and aggregations.

I don’t think it would be too big of a PR adding a custom collation option. It is basically like all the other query options already exposed and passed to the MongoDB driver.

You have my support if you want to start a PR - in that case please re-open the existing issue on Github and let’s continue the conversation there.

I already tried and failed.Maybe the fact that I code on Windows and my limited knowledge of GraphQL has something to do with it.

I don’t think GraphQL knowledge is needed if you want to implement this feature only in the Parse JS SDK at first to make it available in Cloud Code - if that is what you need.

As I said earlier, if you want to give it a try, I will do my best to support you. You would have good guidance with the existing query options, because they are implemented just the same way the collation option would need to be implemented. It’s more or less just the addition of another parameter.

Ok. I’ll give it a shot again (on September I guess). In my first try, I tried to mimic the readPreference implementation, and it’s in a lot of places.

Thx again

1 Like

Yes, read preference seems like a good guidance. We should move the conversation to the Github issue once you start working on it…

@oallouch don’t worry for your pull request, after the API REST part will be okay on parse server, some other maintainer will probably take some next parts to integrate it into the global environment (GraphQL, JS SDK, iOS, Android ) ( for exemple I can take over it for the GraphQL part ).