Skip to content

Instantly share code, notes, and snippets.

@edi9999

edi9999/test.js

Created Jan 15, 2015
Embed
What would you like to do?
(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