Ignoring diacritics in orderBy in RethinkDB?

36 Views Asked by At

The query r.table('categories').orderBy('name') returns my documents in the following order:

  • Cerveja
  • Refrigerante
  • Suco
  • Água

The correct order would take "Água" first:

  • Água
  • Cerveja
  • Refrigerante
  • Suco

How can I make orderBy ignore the diacritics?

1

There are 1 best solutions below

0
On

ReThinkDB doesn't support sorting with Unicode collations (see https://rethinkdb.com/docs/data-types/), so I would save an ASCII version of the name in a separate field for sorting and use the current one for display.