My array value is being overridden by $set, how can I update it properly?
var obj = // contains some other data to update as well
obj.images=images; // updating obj with images []
Units.update({_id: 'id', {$set: obj});
Ultimately, my MongoDB object should look something like this:
{
"_id" : "ZhBgrNFtr2LRPkQrZ",
"sitouts" : "test",
"interiors" : "test",
"features" : "test",
"keyHolder" : "test",
"images" : [
"1445481257465-8678-20130520_113154.jpg", ## `updated value ` ##
"1445481257456-3-20130520_113157.jpg",
"1445481258058-5771-20130520_113202.jpg",
"1445481258230-9603-20130521_075648.jpg"
]
}