L
L
lssssssssssl2021-12-06 21:24:48
MongoDB
lssssssssssl, 2021-12-06 21:24:48

How to index a collection with strings in different languages?

Let's say we have a User collection. It has a name field. One user has name: 'Vasya', and the second one has name: 'Vasya'.
I put the text index on the name field and mongo swears.
What can you think of?

The index is needed so that you can search for matches by characters
. You can, of course, use $regex for this to search for matches by characters, but I do not think that this will be fast in the long run.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question