christkv/node-mongodb-native — Issue #473: Update with $set and { upsert: true } not working
Author: pvorb
Created: 2012-01-10 13:11:02+00:00
State: open

I've got an issue with the update method.

I am trying to update values in a record or create it if it does not exists:

```js
var data = { _id: "some_id" };

this.collection.update({ _id: data._id }, { $set: data }, { upsert: true }, function (err, result) {
if (err) throw err;
else console.log(result);
});
```

This always prints `undefined`. When I browse the mongo db by console, I can't find the saved record.