I have a mongodb table, that contains a fixture of a soccer tournament, so every matchweek looks like this:
"number": 1,
"games" : [
{
"estadio" : "G C",
"arbitro" : "M",
"resultado" : "vs",
"editor" : "Pepe",
"_id" : ObjectId("5af0889e14553f0788bc9db8"),
"equipo_local" : "Las Palmas",
"equipo_visitante" : "Villareal",
"fecha" : "10/05/2018",
"horario" : "16:00",
"hora" : "12:12"
},
{
"estadio" : "Ciudad de Valencia",
"arbitro" : "A Confirmar",
"resultado" : "vs",
"editor" : "No Asignado",
"_id" : ObjectId("5af0889e14553f0788bc9db7"),
"equipo_local" : "Levante",
"equipo_visitante" : "Deportivo",
"fecha" : "28/01/2019",
"horario" : "18:00"
},
..
]
And I want to find all the objects inside "games" of every matchweek that contains "editor" : "pepe",
I've tried something like this
db.fechas.find({"games.editor": "Pepe"})
But that is showing every "games" array that contains an object with "editor": "Pepe", and I want just that specific object, not the whole array.