Answer the question
In order to leave comments, you need to log in
How to sort documents in mongo?
There is a collection of documents like:
{"BookName":"War and peace I", "theme": "war", "author":"Tolstov"},
{"BookName":"War and peace II", "theme": "peace", "author":"Tolstov"}, "BookName":"War and peace |II", "theme": "peace", "author":"Tolstov"},
Is it possible to get sorted selection results in the form two-dimensional array:
["Tolstoy" => ["war"=>1, "peace"=>2]]
I.e. so that at the first level there are arrays with keys - authors, and inside arrays with a topic - the number of its repetitions?
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