I have two objects:
{
"_id" : ObjectId("54be5f5528c13bfc3409e8c2"),
"name" : "Antonio",
"lastname" : "de Cabezón",
"by" : 1510,
"dy" : 1566,
"country" : "spain",
"genre" : [
"classical",
"baroque"
]
}
{
"_id" : ObjectId("54be5f5528c13bfc3409e8c1"),
"name" : "Guillaume-Antoine",
"lastname" : "Calvière",
"by" : 1695,
"dy" : 1755,
"country" : "france",
"genre" : [
"baroque"
]
}
When I do db.currentdb.find ({genre: 'baroque'}), it also returns the first object to me.
I would like to get only an object in which the genre is only "baroque". What would be the right way to do this?
source
share