Think of a lot of ways, such as by storing the pinyin initials of Chinese characters as a comparison (use:https://github.com/hotoo/pinyin), and then sorted by pinyin and separated by letters, but it seems not ideal, is there any better practice?
You should be asking about the design of the data format and the use of mongodb.
An answer in provides a mobile phone address book implementation.
It mainly depends on the needs of the subject.
Output similar to mobile phone address book
What exactly does that mean? Whether the names are grouped according to the sound sequence of the surname or after being divided into group, the names inside should be arranged according to the sound sequence.
You can save whatever you need.
Then, when query data, sort can be used to sort the sound sequence.
For grouping, please refer tohttps://docs.mongodb.com/manual/core/aggregation-pipeline/