Mongoose statics Type Error : no such method
You can't add static methods to your model after it's created, so move the definition of returnEventType
before the call to model
:
portalSchema.statics.returnEventType = function(cb) { cb(EVENT);};var Portal = mongoose.model('Portal', portalSchema);