abzufragen, wie die spezifische Nachricht von _id erhalten. Ich habe eine Datenbank-Schema wie folgt:MongoDB: Wie Feld Array von _id
{
"_id": ObjectID("5846eedaf0b51ed02ed846e2"),
"name": "conversation name"
"messages": [
{
"_id": ObjectID("584820a96866b6283361a4b9"),
"content": "hello",
"status": 0,
"type": 0
},
{
"_id": ObjectID("584820d56866b6283361a4ba"),
"content": "voices/1481122005696.mp3",
"status": 0,
"type": 3
}
]
}
Mögliche Duplikat [MongoDB Abfrage mit elemMatch für verschachtelte Array-Daten] (http://stackoverflow.com/questions/20525754/mongodb-query-with-lemammatch-for-nested-array-data) – Yogesh