From inside a static method, you can also create a new document by doing :
schema.statics.createUser = function(callback) {
var user = new this();
user.phone_number = "jgkdlajgkldas";
user.save(callback);
};
From inside a static method, you can also create a new document by doing :
schema.statics.createUser = function(callback) {
var user = new this();
user.phone_number = "jgkdlajgkldas";
user.save(callback);
};