I'm using Spring Data's CrudRepository with mongodb and i have some issue to write a query which will select a document with specific subdocument value. Here's an example:
{
"_id" :,
"_class" :,
"matchHeader" : {
"suspend" : {},
"active" : true,
"booked" : true,
"eventId" : NumberLong(1009314492),
"status" : ""
},
"matchInfo" : {
}
}
}
i need to select the document with specific eventId field in matchHeader subdocument. i tried to write a function like this findByMatchHeaderEventId(id) but it doesn't helped at all.how can i achieve that?