I am new to node.js, trying to write a module, but I ran into a problem .. I am registering in a child module:
var User = require('./schema'); User.userIsExist = function(id) { User.findOne({id: id}), function(err, tester) { console.log(tester); } } module.exports = User; and mainly:
var User = require('./model').User; if(User.userIsExist(userinfo.uid)) { // Авторизируемся } But at the output I get TypeError: User.userIsExist is not a function
what am I doing wrong?