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

TypeError: Cannot read property 'commandsTakeWriteConcern' of null

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.3
    • Affects Version/s: 3.0.2
    • Component/s: Native
    • Environment:
      Node 4.8.6

      This simple Node app:

      'use strict'
      
      var mongodb = require('mongodb')
      
      var server = new mongodb.Server('localhost', 6379)
      var db = new mongodb.Db('integration', server)
      
      db.dropCollection('testCollection2', function() {})
      

      results in this error when executed:

      $ node test/versioned/mongodb/test.js
      /Users/nwolfe/work/nr/nodejs_agent/test/versioned/mongodb/node_modules/mongodb/lib/db.js:489
        if (self.s.topology.capabilities().commandsTakeWriteConcern) {
                                          ^
      
      TypeError: Cannot read property 'commandsTakeWriteConcern' of null
          at decorateWithWriteConcern (/Users/nwolfe/work/nr/nodejs_agent/test/versioned/mongodb/node_modules/mongodb/lib/db.js:489:37)
          at Db.dropCollection (/Users/nwolfe/work/nr/nodejs_agent/test/versioned/mongodb/node_modules/mongodb/lib/db.js:865:3)
          at Object.<anonymous> (/Users/nwolfe/work/nr/nodejs_agent/test/versioned/mongodb/test.js:14:4)
          at Module._compile (module.js:409:26)
          at Object.Module._extensions..js (module.js:416:10)
          at Module.load (module.js:343:32)
          at Function.Module._load (module.js:300:12)
          at Function.Module.runMain (module.js:441:10)
          at startup (node.js:140:18)
          at node.js:1043:3
      

      Is this little app incorrect, or is this a bug in the driver?

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            nwolfe Natalie Wolfe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: