db.collection('allowedmacs').find().toArray(function(err, docs) {
console.log(docs);
}
var findMacs = function(db, callback) {
var cursor =db.collection('allowedmacs').find( );
cursor.each(function(err, doc) {
assert.equal(err, null);
if (doc != null) {
console.dir(doc);
} else {
callback();
}
});
};
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
findMacs(db, function() {
db.close();
});
});