db.alura.update(
{
"registrado":false //Conditions
},
{
$set:{
"registrado":true // Update value
}
},
{
multi:true //For update multiple lines at same time
}
)
db.alura.update(
{
"cursos.nome":"coca cola" //Conditions
},
{
$set:{
"cursos.$.habilidade":"facil" // $ -> Scans the array changing the value
}
},
{
multi:true //For update multiple lines at same time
}
)