Skip to content

Instantly share code, notes, and snippets.

@adaptivedev
Created March 26, 2014 12:23
Show Gist options
  • Save adaptivedev/9781956 to your computer and use it in GitHub Desktop.
Save adaptivedev/9781956 to your computer and use it in GitHub Desktop.
how can I call findAll in games.js from turnys.js (how do I define an object-function that defines "send"
creating 1 turny per 1 game
/Users/rover/.nvm/v0.10.26/lib/node_modules/mongodb/lib/mongodb/connection/base.js:242
throw message;
^
TypeError: Object function (){
send = function(msg) {
console.log("populateDb: gamesAll: res: send: msg="+msg);
};
} has no method 'send'
exports.findAll = function(req, res) {
gamedb.collection('games', function(err, collection) {
collection.find().toArray(function(err, items) {
res.send(items);
});
});
};
var gamesAll = games.findAll(null, send = function(){
send = function(msg) {
console.log("populateDb: gamesAll: res: send: msg="+msg);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment