79302307

Date: 2024-12-23 06:26:00
Score: 3
Natty:
Report link

Yes you just have to do the following: export const ModelName = mongoose.models?.ModelName || mongoose.model('ModelName', modelSchema) in this way the model will not be overwrited

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Muhammad