[IMPLEMENTED] Sorting for non alphabetic chars in GraphQL

In GraphQL sorting features, the ordering feature ç, ​​ş, ğ, ö, ü does not work in Latin alphabet characters (for example: Turkish). I believe this should be improved and corrected.

FROM: 15 Development Suggestions

Sounds like a bug actually or a limitation of MongoDB. Do you have more details about that?

of course, for example, I create a schema. to include countries and provinces of countries;

Country: Turkey > District: İstanbul
Country: Turkey > District: Şırnak
Country: Turkey > District: Ankara
Country: Turkey > District: Lüleburgaz
Country: Turkey > District: Mersin
Country: Turkey > District: Bursa
Country: Turkey > District: Zonguldak

If I say sort by district in graphQL, it cannot sort the fields that start with Turkish characters and puts them at the end of the data.

Result:
Ankara
Bursa
Lüleburgaz
Mersin
Zonguldak
İstanbul
Şırnak

is this not correct? I guess they are just sorted by numeric value inside the unicode table.

In other database you have to define the collation. Or you have to normalize the data.

incorrect sorting occurs.Actually it should be in the order I-İ S-Ş

I got it, but I am not sure if I can do anything about that.

EDIT: I could define a new operator for collation. Not sure if that would work.

I have implemented that. There is a new collation option now, where you can define the language code.

1 Like