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

Unhandled rejection Error: autoCreate is an invalid option. #9466

Closed
Bec-k opened this issue Oct 5, 2020 · 5 comments
Closed

Unhandled rejection Error: autoCreate is an invalid option. #9466

Bec-k opened this issue Oct 5, 2020 · 5 comments
Milestone

Comments

@Bec-k
Copy link

Bec-k commented Oct 5, 2020

mongoose.set('autoCreate', true);

version v5.10.7

https://mongoosejs.com/docs/guide.html#autoCreate

@Bec-k
Copy link
Author

Bec-k commented Oct 5, 2020

Have anyone tested this option?

@Bec-k
Copy link
Author

Bec-k commented Oct 5, 2020

ok, it seems there is another way through options here:

if ('autoCreate' in options) {

Will try that out now.

@Bec-k
Copy link
Author

Bec-k commented Oct 5, 2020

I see that there is a test for connection option here:

autoCreate: true

@Bec-k
Copy link
Author

Bec-k commented Oct 5, 2020

but no test for mongoose.set('autoCreate', true);

@vkarpov15 vkarpov15 added this to the 5.10.9 milestone Oct 6, 2020
@vkarpov15
Copy link
Collaborator

You're right: the issue is that we support autoCreate as a schema option and a connection option, but not a global option. Will add that in v5.10.9 to make it more consistent with autoIndex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants