I used the example of readme file, and after the server starts I got the error ReferenceError: Schema is not defined
static schema () {
return {
username: String,
childs: [{
type: Schema.ObjectId,
ref: 'UserSchema'
email: {
type: String,
type: String,
required: true,
unique: true,
lowercase: true,
trim: true,
validate: {
validator: function (val) {
return isEmail(val)
message: '{VALUE} is not a valid email'
apparently the scope of the schema variable, has been lost