insert not running callback when database doesn't exist, but still works

10 views
Skip to first unread message

burtgummer45

unread,
May 19, 2015, 6:50:19 PM5/19/15
to node-mong...@googlegroups.com

> db.dropDatabase()
 
Run the below code.  It will work but the first time it runs the callback is not called.  Is this a bug or just a funny mongodb thing?


var collection = mongo_db.collection('users');

collection
.insert( { 'lastname': 'Gummer' }, function( err, result ) {                                                                     console.log( err );                                                                                                                     console.log( 'callback insert' );
} );  

Reply all
Reply to author
Forward
0 new messages