I have a query on the @MongoFindQuery annotation. Array level filtering is what i want.
For Eg: Consider this Employee collection. One employee has many vehicles:
_id: ObjectId("12hd74svsd77")
employeeName: "James Bond"
employeeCode: 700
vehicles: Array
0: Object
number:1234676767
color: Black
type: two wheeler
1: Object
number: 9898999898
color: White
type: four wheeler
_id: ObjectId("12jh5sd40da")
employeeName: "Ethan Hunt"
employeeCode: 111
vehicles: Array
0: Object
number: 8765409956
color: Green
type: four wheeler
1: Object
number: 9070712223
color: Red
type: two wheeler
2: Object
number: 3232323231
color: Silver
type: two wheeler
Ask: Input to my repository will be vehicle number and in return I want the Employee with single vehicle. Eg: If the input is 9070712223 then my Micronaut repository method annotated with @MongoFindQuery should return “Ethan Hunt” Employee with one vehicle object of color “Red” and type “two wheeler” in the vehicles array.
Can this be achieved using @MongoFindQuery annotation ?