Created
October 24, 2011 13:26
-
-
Save rentalcustard/1309020 to your computer and use it in GitHub Desktop.
Web development in 2011. Apparently.
This file contains 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
//from https://github.com/christkv/node-mongodb-native | |
var p_client = new Db('integration_tests_20', new Server("127.0.0.1", 27017, {}), {'pk':CustomPKFactory}); | |
p_client.open(function(err, p_client) { | |
p_client.dropDatabase(function(err, done) { | |
p_client.createCollection('test_custom_key', function(err, collection) { | |
collection.insert({'a':1}, function(err, docs) { | |
collection.find({'_id':new ObjectID("aaaaaaaaaaaa")}, function(err, cursor) { | |
cursor.toArray(function(err, items) { | |
test.assertEquals(1, items.length); | |
// Let's close the db | |
p_client.close(); | |
}); | |
}); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment