typegoose: Implicitly setting "Mixed" is not allowed! even when Mixed is set explicitly
Versions
- NodeJS: v12.16.2
- Typegoose(NPM):6.5.0
- Typegoose(GIT): commithash
- mongoose: 5.9.10
- mongodb: v4.2.5
What is the Problem?
The fix for #152 has made it so the Implicitly setting "Mixed" is not allowed!
warning is shown even if Mixed
is set explicitly according to the documentation.
Code Example
@modelOptions({ schemaOptions: { timestamps: true }, options: { customName: 'foo' } })
class Foo {
@prop({ type: mongoose.Schema.Types.Mixed })
bar?: object;
}
The above model triggers the warning even though it’s implemented according to https://typegoose.github.io/typegoose/docs/decorators/prop/#type
Do you know why it happenes?
no
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (17 by maintainers)
setting allowMixed solves the issue
i know the text of the warning is kinda misleading and that i need to change it this message will always appear when an
Mixed
is detected, even if set manually, you can change the Severity of the message with this option (to throw, warn or allow it)your second comment is unrelated to the issue, but what is this
ObjectId
you use there? (maybe imported from mongodb?)@anuraghazra thats what stands in the mentioned documentation