Answer the question
In order to leave comments, you need to log in
Is there an analogue of mysql query in MongoDB?
I need to output and group the first letters of existing entries for an alphabetical index.
In mysql, this question solved the query, how to do the same in MongoDB?
SELECT
SUBSTRING(`Name` FROM 1 FOR 1 ) as prefix
FROM
`table`
GROUP BY
prefix
ORDER BY prefix
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question