Mongoose generators helper functions