The server is crashing because of the line isAdmin: { isAdmin: boolean, default: false },
It's probably crashing because isAdmin is not valid field of mongoose schema, instead your schema declaration schould looks like
isAdmin
new mongoose.Schema({ ...// rest of your schema isAdmin: {type: Boolean, default: false} })
so simply replace isAdmin: boolean with type: Boolean
isAdmin: boolean
type: Boolean
Copyright © 2021 Jogjafile Inc.
It's probably crashing because
isAdminis not valid field of mongoose schema, instead your schema declaration schould looks likeso simply replace
isAdmin: booleanwithtype: Boolean