Ich habe eine Sammlung von Objekten, die ein Unterwörterbuch haben, das Daten für eine bestimmte Institution enthält, identifiziert durch die provider_id
.Abfrage Filialdokumente MongoDB Node.JS
Wie kann ich eine Sammlung abfragen, products
und nur Produkte zurückgeben, die eine bestimmte Provider-ID enthalten?
"natl_total_cost": 1.27478784E9,
"natl_average": 8338.487,
"natl_report_count": 152880,
"name": "Wax",
"provider_cost_dict": {
"340008": {
"report_count": 181,
"total_cost": 1335465,
"average_cost": 7378.26
},
"340001": {
"report_count": 643,
"total_cost": 5026724,
"average_cost": 7817.6113
},
...
Wie konnte ich alle Produkte abfragen, so dass sie nur Produkte, die eine bestimmte Anbieter-ID in ihren provider_cost_dict
enthalten zurückkehren?
können Sie Ihr Schema posten ?? Was ist '340008' im obigen Dokument? –
Die '340008' ist eine Provider-ID, tut mir leid. – Clip