79347312

Date: 2025-01-11 00:38:05
Score: 3
Natty:
Report link

Mongoose virtual properties apparently cannot use hyphens in their names, so I believe it might be related to the problem you identified. I do not see this documented in https://mongoosejs.com/docs/tutorials/virtuals.html, but just tested it by changing a virtual property name to have a hyphen and made the same change on the template. It returns NaN. Remove the hyphen on the model's virtual property name and template, and it works again.

Reasons:
  • Blacklisted phrase (1): this document
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Merry