1

複数のサブ配列を持つこの配列があります。

> db.alumnos111.findOne({curp:'AELJ951211MASCPN04'})
{
        "_id" : ObjectId("520d5440bee9577c283542c3"),
        "nocontrol" : "10301051680201",
        "nombre" : "JANETTE ARACELI",
        "paterno" : "ACERO",
        "materno" : "LOPEZ",
        "curp" : "AELJ951211MASCPN04",
        "generacion" : "2010-2013",
        "carrera" : "INFORMÁTICA",
        "clv_centro" : "01DCT0001F",
        "estado" : "AGUASCALIENTES",
        "plantel" : "CBTIS NO. 168",
        "id_plantel" : "513",
        "materias" : [
                {
                        "semestre" : "4",
                        "nombre_asignatra" : "ECOLOGÍA",
                        "grupo" : "4A",
                        "turno1" : "2001",
                        "parcial1" : "10",
                        "parcial2" : "9",
                        "parcial3" : "9",
                        "calificacion" : "9",
                        "periodo" : "SEMESTRAL 2 - 2011",
                        "id_periodo" : "111",
                        "id_plangpo" : "14",
                        "id_materia" : "4529"
                },
                {
                        "semestre" : "4",
                        "nombre_asignatra" : "FÍSICA I",
                        "grupo" : "4A",
                        "turno1" : "2001",
                        "parcial1" : "8",
                        "parcial2" : "10",
                        "parcial3" : "10",
                        "calificacion" : "9",
                        "periodo" : "SEMESTRAL 2 - 2011",
                        "id_periodo" : "111",
                        "id_plangpo" : "14",
                        "id_materia" : "4530"
                },          
                {
                        "semestre" : "4",
                        "nombre_asignatra" : "INGLÉS IV",
                        "grupo" : "4A",
                        "turno1" : "2001",
                        "parcial1" : "8",
                        "parcial2" : "10",
                        "parcial3" : "9",
                        "calificacion" : "9",
                        "periodo" : "SEMESTRAL 2 - 2011",
                        "id_periodo" : "111",
                        "id_plangpo" : "14",
                        "id_materia" : "4531"
                },        

        ]
}

{"materias.id_materia" : '$in' ("4531",'4530'),'parcial3':10}現在のサブアレイをどのようにフィルタリングすればよい_idですか?

PHPdb->findや JavaScript のヘルプは役に立ちます。

4

2 に答える 2