With following document
Diagrams
{
name:'fig1',
pointsFrom:[point1,point2],
pointsTo:[],
moveCount:0
}
How to update above document and move point1 from pointsFrom to pointsTo array using collections.update api, without actually fetching complete object ?
update(
{name:'fig1'}, //criteria
{
$inc:{moveCount:1},
$pull: {pointsFrom:point1} ,
$push:{pointsTo:point1}
},//Modifier
false,//upsert false
true //update multiple documents
)