how can I make a $ pull on a sub-element of an array in mongodb

0

Good morning I want to do a pull in a mongodb arrangement, like the next one

{ 
    _id:ObjectId(123456789),
    elementos:[
        {
          name:"x",
          items:[
               {
                    _id:ObjectId(123456788),
                    grupos:[
                        {
                           name:"grupo2",
                           codigo:"XXXX.0"
                        },

                        {
                           name:"grupo3",
                           codigo:"XXXX.1"
                        },
                        {
                           name:"grupo4",
                           codigo:"XXXX.2"
                        }   
                    ]
               }
          ]
        },
        {},...
        {}
    ]

}

I want to pull the element of the group whose name: "group3" How could I do this?

    
asked by Nestor Rojas P. 13.02.2018 в 14:34
source

0 answers