Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Type definition for overwriteModels:true in schemaOptions #12816

Closed
2 tasks done
i-rebel-aj opened this issue Dec 20, 2022 · 0 comments · Fixed by #12817
Closed
2 tasks done

Missing Type definition for overwriteModels:true in schemaOptions #12816

i-rebel-aj opened this issue Dec 20, 2022 · 0 comments · Fixed by #12817
Labels
typescript Types or Types-test related issue / Pull Request

Comments

@i-rebel-aj
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

6.3.3

Node.js version

16.13.2

MongoDB server version

5.x

Typescript version (if applicable)

4.5.2

Description

Citing issue #10931,

A pull request #11244 was made, which added property overwriteModels to schemaOptions. The subsequent type definition of the Boolean is missing in file types/schemaoptions.d.ts

Steps to Reproduce

it('Should allow reusing discriminators (gh-10931)', async function() {
const options = { discriminatorKey: 'kind', overwriteModels: true };
const eventSchema = new mongoose.Schema({ time: Date }, options);
const Event = db.model('Event', eventSchema);

In tests it accepts property overwriteModels: true

Expected Behavior

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants