I am currently trying to query a array in mongodb, I want to look for all the fields that have the id: "ZhU76Ta
" in them, but the array to search is barryed in a other doc, so my query looks something like this: {"punishdata.Entrys.0.id": "ZhU76Ta"}
but this only query the first doc in the array, I tryed something like this {"punishdata.Entrys.*.id": "ZhU76Ta" }
but this also does not work, dose anybody know how to do this?
Document structure:
{
"_id" : ObjectId("5b212e540a975a231c85419c"),
"name" : "Starmixcraft",
"punishdata" : {
"Entrys" : [
{
"id" : "ZhU76Ta",
"end" : NumberLong(-2),
"start" : NumberLong(1528901227837),
"time" : NumberLong(-2)
}
]
}
}