var MongoClient = require('mongodb').MongoClient,
test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
// Create a collection we want to drop later
var collection = db.collection('simple_query');
// Insert a bunch of documents for the testing
collection.insertMany([{a:1}, {a:2}, {a:3}], {w:1}, function(err, result) {
test.equal(null, err);
// Perform a simple find and return all the documents
collection.find().toArray(function(err, docs) {
test.equal(null, err);
test.equal(3, docs.length);
db.close();
});
});
});