0

The server is crashing because of the line isAdmin: { isAdmin: boolean, default: false },

enter image description here

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
mertvae
  • 3
  • 1

1 Answers1

0

It's probably crashing because isAdmin is not valid field of mongoose schema, instead your schema declaration schould looks like

new mongoose.Schema({
...// rest of your schema
isAdmin: {type: Boolean, default: false}
})

so simply replace isAdmin: boolean with type: Boolean

Arek Gil
  • 119
  • 1
  • 4