Ich habe eine die folgende SammlungMongoDB Aggregation
{ "data" :[
{ "country" :"USA", "state": "NJ", "County" : "Middlesex", "city" : "Edison", "population" :0923422 },
{ "country" :"USA", "state": "NJ", "County" : "Mercer", "city" : "Princeton", "population" :0923422 },
{ "country" :"USA", "state": "NY", "County" : "Middlesex", "city" : "Edison", "population" :234234 },
{ "country" :"USA", "state": "NY", "County" : "Ocean", "city" : "Albony", "population" :234324 },
{ "country" :"USA", "state": "PA", "County" : "Central", "city" : "Edison", "population" :0923422 },
{ "country" :"USA", "state": "NJ", "County" : "Middlesex", "city" : "Edison", "population" :23432 },
{ "country" :"USA", "state": "OH", "County" : "Middlesex", "city" : "Cincinatti", "population" :0923422 },
{ "country" :"USA", "state": "OH", "County" : "Middlesex", "city" : "Columbos", "population" :23432 } ]
}
suchen, um die Gesamtbevölkerung nach Land, Bundesland, Landkreis und Stadt mit verschachtelter Aggregation in mongodb zu finden.
Bitte helfen Sie mit der Abfrage.
Wirklich eine herausfordernde. Kann nicht in verschiedenen Formaten produzieren. – notionquest