Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-485

updateOne crash when a new document is inserted for {upsert: true, w: 0}

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.34
    • Affects Version/s: 2.0.33
    • Component/s: None
    • Environment:
      mac os x 10.9.5
      node v0.12.4

      updateOne crash is occurred when a new document is inserted for

      {upsert: true, w: 0}

      ,
      here is the test code:

      var mongo = require('mongodb');
      
      function test(cb) {
      	var mongoClient = new mongo.MongoClient();
      	mongoClient.connect('mongodb://localhost:27017/test', function (err, db) {
      		if (err) {
      			return cb(err);
      		}
      		db.collection('try').updateOne({_id:1}, {$set:{x:1}}, {upsert:true, w: 0}, function(err, result){
      			return cb(err, result);
      		})
      	});
      }
      
      test(function(err, result){
      	console.log(err);
      	console.log(result);
      });
      

      After execute the code,

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            qianyong qianyong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: