in my Collection I have this kind of documents:
{
"_id" : ObjectId("5ebf6e2293c4b6fca459c03a"),
"country" : "DE",
"name" : "Karlshuld",
"lat" : "48.6819",
"lng" : "11.28503"
}
As you can see, it's a "database" with names of cities and their geo coordinates. My use case for this data is, that a user enters a (partial) name of the city and gets a list of matching documents.
My problem is, that I have to sort the data, because if a user just type in 3 letters, there are globally a lot of cities starting with the given string.
So I want to do a kind of "custom sorting". If a user is a german user, I want to sort the results by country, where "DE" comes first, following by "AT" and "CH". And then the other results.
How can I do this?