It looks like you have a proxy object created using a prototype. In this case, you will have to “update” the instance in order to use it, as Reynos mentioned.
I think what you expect is what the object literal provides, not the prototype class. Sort of:
module.exports.PollModel = {
findPolls : function (callback) { ... },
findById : function (id, callback) { ... },
updateById : function (id, body, callback) { ... }
}
I personally used the mongoose pattern.
Mongoose Schema , , .
var Poll = require('./models').Poll;
var instance = new Poll();
instance.save();
instance.find(function(err, docs){});
Poll.find(function(err, docs){});
Poll.save();