Skip to content

Instantly share code, notes, and snippets.

@edi9999
Created January 15, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edi9999/27a7790580a88628aa51 to your computer and use it in GitHub Desktop.
Save edi9999/27a7790580a88628aa51 to your computer and use it in GitHub Desktop.
(function() {
var MongoClient, config;
config = require('../config.js');
MongoClient = require('mongodb').MongoClient;
MongoClient.connect("mongodb://127.0.0.1:27017/" + config.General.database, function(err, db) {
var callback, callbackOne;
callback = function(err, hands) {
if (err) {
throw err;
}
return console.log('find:' + hands.length);
};
callbackOne = function(err, hands) {
if (err) {
throw err;
}
return console.log('findOne:' + hands);
};
db.collection('hands').find({
"processed": null
}).toArray(callback);
db.collection('hands').findOne({
"processed": null
}, callbackOne);
return db.collection('hands').count({
"processed": null
}, function(err, c) {
return console.log('count:' + c);
});
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment