I whish to update a collection 'pages' in a database.
I get no error, however, updates aren't applied.
i prepare de fields to insert/update :
var page2update={
source_id: source._id.toString()
, mtime: new Date()
};
pages_collection.update({_id: page._id}, {$set: page2update}, {safe: 1}, function(err, result) {
if(err){
console.log((new Date()) + " An error occurs: "+err);
}else{
console.log((new Date()) + " result = "+result);
}
});
on the console i got :
Mon Dec 16 2013 07:11:59 GMT+0100 (CET) result = 1
meaning the result is ok ?
i have tested also for the options part of this command {w: 1} and also no options at all (default?).
the results are the same : no update.
nor the filed mtime (modify time) is updated,
nor the field 'source_id' is created, why ?
i have used the same kind of update in another db (using option {w: 1}) successfully.
any idae ?