0
Ich habe Dokumente wie unten.Embedded Dokument in Mongodb entpacken
{
"_id": {
"$oid": "526fdc1fd6b0a8182300009c"
},
"body": "test abc",
"emb" : [{"body":"text","em":"abc.com","auth":"XYZ"},
{"body":"text","em":"abc.com","auth":"ABC"}
]
}
{
"_id": {
"$oid": "526fdc1fd6b0a8182300009d"
},
"body": "test abc",
"emb" : [{"body":"text","em":"abc.com","auth":"PQR"},
{"body":"text","em":"abc.com","auth":"ABC"}
]
}
Wenn ich will, die Dokumente in der inneren Anordnung Vorkommen jeder „Auth“ zählen, wie kann ich das tun? Das Ergebnis ich erwarte ist
"ABC":2
"PQR":1
"XYZ":1