typegoose: Getting error Invalid schema configuration: `MD` is not a valid type at path `updatedAt`
Versions
- NodeJS: 0.0.0
- Typegoose(NPM): 6.1.8
- mongoose: 5.7.7
- mongodb: 3.3.6
- jest: 24.9.0,
What is the Problem?
Getting error:
TypeError: Invalid schema configuration: `MD` is not a valid type at path `updatedAt`. See http://bit.ly/mongoose-schematypes for a list of valid schema types.
at Schema.Object.<anonymous>.Schema.interpretAsType (node_modules/mongoose/lib/schema.js:901:11)
at Schema.Object.<anonymous>.Schema.path (node_modules/mongoose/lib/schema.js:602:27)
at Schema.add (node_modules/mongoose/lib/schema.js:442:12)
at Schema.Object.<anonymous>.Schema.setupTimestamp (node_modules/mongoose/lib/schema.js:1094:8)
at new Schema (node_modules/mongoose/lib/schema.js:138:8)
at Object._buildSchema (node_modules/@typegoose/typegoose/src/internal/schema.ts:56:11)
at buildSchema (node_modules/@typegoose/typegoose/src/typegoose.ts:170:9)
at Object.getModelForClass (node_modules/@typegoose/typegoose/src/typegoose.ts:105:58)
Code Example
Do you know when it happenes?
This error is thrown when I’m trying to run my jest test else it runs fine.
Do you know why it happenes?
no
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (10 by maintainers)
at
node_modules/jest-date-mock/lib/mockDate.js
MD
is used, it probably comes from there, and mongoose expects an Date not an MD