Created
January 15, 2015 12:49
-
-
Save edi9999/74ab937bf7636d4bf9cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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