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 ?

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to