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

db.createCollection after db.close() > does not handle error

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.1.0
    • Affects Version/s: 2.0.47
    • Component/s: None
    • Environment:
      ubuntu 14.04, node 0.10, mongodb 3.07

      I re-created a minimalistic example that produces the problem:

      var mongoDB = require('mongodb');

      var randomIdentifier = 'Demo'+Math.random().toString(36).slice(-8);

      try
      {
      mongoDB.MongoClient.connect("mongodb://localhost:27017/"+randomIdentifier,

      {native_parser:true}

      , function(err, db) {
      if(err)

      { console.log(err); }

      db.close(function(err, result) {
      if(err)

      { console.log(err); }

      db.createCollection('nonexistent',

      {'w':1}

      , function(err, collection) {
      if(err)

      { console.log('will never get here'); console.log(err); }

      else

      { console.log('or here'); }

      })
      });
      });
      }
      catch(err)

      { console.log("or here for that matter"); }

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            Magnitus Eric Vallee [X]
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: