Skip to content

Instantly share code, notes, and snippets.

@edi9999
Created January 15, 2015 12:49
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/74ab937bf7636d4bf9cf to your computer and use it in GitHub Desktop.
Save edi9999/74ab937bf7636d4bf9cf 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, callbackCount, condition;
callback = function(err, hands) {
if (err) {
throw err;
}
console.log('find:' + hands.length);
return console.log(hands);
};
callbackCount = function(err, c) {
return console.log('count:' + c);
};
condition = {
"processed": null
};
db.collection('hands').count(condition, callbackCount);
db.collection('hands').find(condition).toArray(callback);
return db.collection('hands').find(condition, {
raw: true
}).toArray(callback);
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment