Created
September 2, 2011 08:33
-
-
Save Orion98MC/1188180 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 collection; // Global collection | |
var onConnect = function(err, db) { | |
db.dropDatabase(function() { | |
db.collection("foo", function(err, coll) { | |
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