0
ich meine db haben in Form folgendenMongoDB - Finden von Daten aus einem Array in einem Objekt
{
"_id" : ObjectId("56fc92adcf908c9f296e5885"),
"_class" : "com.abc.ppm.dto.AccessAttemptDTO",
"url" : "/myProject/edit",
"ipAddress" : "127.0.0.1",
"param" : {
"iecode" : [
"P1234"
],
"id" : [
"5696578c6d34f835dc632fdd "
]
},
"accessTime" : "30-3-2016 10:59:57",
"email" : "[email protected]",
"entity" : "admin",
"entityCode" : ""
},
{
"_id" : ObjectId("56fc92adcf908c9f296e5887"),
"_class" : "com.abc.ppm.dto.AccessAttemptDTO",
"url" : "/myProject/edit",
"ipAddress" : "127.0.0.1",
"param" : {
"iecode" : [
"P1122"
],
"id" : [
"5696578c6d34f835dc632fdd "
]
},
"accessTime" : "30-3-2016 10:59:57",
"email" : "[email protected]",
"entity" : "admin",
"entityCode" : ""
}
Jetzt möchte ich alle enries finden, wo iecode ist 'P1234'. Wie mache ich das? (Hinweis: iecodes Wert wird in String-Array-Format gespeichert.)