Node + mongo-native: how to find and update value in collection?

I have user accounts, expiring by time. Time is stored in MongoDB as a long in milliseconds. Users are identified by _id. Here's the schema:

{
    "_id": {
        "$oid": "506a1438be4f73c11c000002"
    },
    "email": "admin",
    "password": "admin",
    "first_name": "admin",
    "last_name": "admin",
    "country": "USA",
    "group": "admin",
    "expires": 1349129272918
}

To add +N days to user accounts, I use find() and then update () (dont know why, but findAndUpdate can't get previous value):

app.post('/users/add', function(req,res){
    addDays(req.body.id, req.body.days, function(status){
        res.send(200);
    })
});

function addDays(id, days, callback) {
    var obj_id = BSON.ObjectID.createFromHexString(id);
    db.collection("users", function(error, collection) {
        collection.find({_id: obj_id}, function(err, user) {
            var oldexp = user.expires;
            if (oldexp < new Date().getTime() ) {
                var newexp = new Date().getTime() + (86400000*days);
            } else {
                var newexp = oldexp + (86400000*days);
            }
            collection.update({_id: obj_id}, {
                $set: {
                    "expires": parseInt(newexp)
                }
            }, function(err, result) {
                callback('ok');
            });
        });
    });
}

To launch update days function, I use JS on frontend:

  $(".addDays").live("click", function(){
    var that = $(this);
    var id = that.closest('.row').find('input[name=id]').val();
    alert(id);
    $.post('/users/add', {
        "id": id,
        "days": 10
      }, function(data){
          alert(data);
      });
  });

Var id is a string-decoded ObejctID (like "506a1438be4f73c11c000002"), for every user it's stored in the nearest input(name="id").

After I try to add days, even I get OK, my collection becomes damaged. Does anyone know why? Thanks!

Since you say you need to make different update depending on if the current value is greater than "now" or not, why not do it with these two updates:

now = new Date().getTime();
db.users.update({_id:obj_id, expires:{$gte:now}, {$inc:{expires:now+{86400000*days}})
db.users.update({_id:obj_id, expires:{$lt:now}, {$set:{expires:now+86400000*days}})

I think this is safer than the logic you have now.

Note that the order of updates here matters to make sure only one of the two statements has effect.