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

Error: 'useCreateIndex' is an invalid option #41

Open
johncardozo opened this issue Oct 22, 2021 · 8 comments
Open

Error: 'useCreateIndex' is an invalid option #41

johncardozo opened this issue Oct 22, 2021 · 8 comments

Comments

@johncardozo
Copy link

When I try to execute the seeder it shows the error message:

if (VALID_OPTIONS.indexOf(key) === -1) throw new Error(`\`${key}\` is an invalid option.`);
                                         ^
Error: `useCreateIndex` is an invalid option.

The option UseCreateIndex is deprecated in Mongodb. Is there any way to connect to database with an options object instead of just a ConnectionString?
I'm trying to execute:

seeder.connect(process.env.DB_CONNECTION, function () {
...
}
@baronnath
Copy link
Contributor

baronnath commented Oct 27, 2021

Deleting following lines from index.js is enough. These options are deprecated and now are true by default.
mongoose.set("useCreateIndex", true); mongoose.set("useNewUrlParser", true);

@skeeith
Copy link

skeeith commented Jan 10, 2022

When will the package be updated? so we won't have manually delete the 2 lines every installation?

@cristianm
Copy link

+1 When will the package be updated?

1 similar comment
@joshuarussell76
Copy link

+1 When will the package be updated?

@Suzan-Dev
Copy link

+1

1 similar comment
@narendra-paiteq
Copy link

+1

@mohitharshan123
Copy link

@seanemmer

@tuguldur
Copy link

tuguldur commented Mar 5, 2024

+1

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

9 participants