seanemmer / mongoose-seed

Seed data population for Mongoose
MIT License
52 stars 33 forks source link

Error: 'useCreateIndex' is an invalid option #41

Open johncardozo opened 2 years ago

johncardozo commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

cristianm commented 2 years ago

+1 When will the package be updated?

joshuarussell76 commented 2 years ago

+1 When will the package be updated?

Suzan-Dev commented 2 years ago

+1

narendra-paiteq commented 1 year ago

+1

mohitharshan123 commented 12 months ago

@seanemmer

tuguldur commented 7 months ago

+1