-
-
Save glenjamin/1188205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Db = require('mongodb').Db, | |
Connection = require('mongodb').Connection, | |
Server = require('mongodb').Server; | |
var db = new Db('mongo-test', new Server("localhost", Connection.DEFAULT_PORT, {}), {native_parser:false}); | |
var context = this; | |
var onConnect = function(err, db) { | |
db.dropDatabase(function() { | |
db.collection("foo", function(err, coll) { | |
context.collection = coll; | |
console.log("foo collection set"); | |
}); | |
}); | |
}; | |
db.open(onConnect); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment