Mangosta eliminar documento de matriz

Ejemplos de código

1
0

mangosta eliminar documento de matriz

//db.collection.findOneAndUpdate( filter, update, options )
//{ $pull: { <field1>: <value|condition>} }

List.findOneAndUpdate({ name: listName }, { $pull: { <field1>: <value|condition> } }, function(err, foundList) {
    if (!err) {
         //your code
     }
}); //Here List is my collection name

//By Reacto Kalyan
1
0

mangosta eliminar elemento de matriz

db.survey.update( // select your doc in moongo
    { }, // your query, usually match by _id
    { $pull: { results: { $elemMatch: { score: 8 , item: "B" } } } }, // item(s) to match from array you want to pull/remove
    { multi: true } // set this to true if you want to remove multiple elements.
)
0
0

mangosta eliminar documento de matriz

Favorite.updateOne( {cn: req.params.name}, { $pullAll: {uid: [req.params.deleteUid] } } )
0
0

mangosta quitar documento de la matriz

Favorite.updateOne( {cn: req.params.name}, { $pullAll: {uid: [req.params.deleteUid] } } )

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................