Using Mongodb database, the best practice to achieve output similar to mobile phone address book is What?

  node.js, question

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.

https://segmentfault.com/q/1010000003891963
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/