mongodb/node-mongodb-native — pull request #1191 by gabmontes (2014-07-08 14:35:16+00:00)
Title: Added test for updates with w=0 in Connection String Options

Using MongoDB 2.6.1 and the driver 1.4.7 found that if a document is updated with no write concern, nothing is written to the database. For instance, the following code does not insert the document

```javascript
var mongodb = require('mongodb');
mongodb.MongoClient.connect("mongodb://localhost:27017/test?w=0", function (err, db) {
db.collection("acollection").update({"key": "value"}, {"$inc": {"count": 1}}, {"upsert": true}); // nothing will be updated
process.exit(0);
});
```

It is worth noting that the write concern is set to 0 in the connection string and this appears to be causing the issue. When set through an options object, all goes fine.

This problem started in 1.4.2 and can be seen up to 1.4.7. On the other hand, version 1.4.1 and below work properly.

The pull request contains a test case that checks this problem.