mongoose-seed icon indicating copy to clipboard operation
mongoose-seed copied to clipboard

Error: 'useCreateIndex' is an invalid option

Open johncardozo opened this issue 4 years ago • 8 comments
trafficstars

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 () {
...
}

johncardozo avatar Oct 22 '21 22:10 johncardozo

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);

baronnath avatar Oct 27 '21 22:10 baronnath

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

skeeith avatar Jan 10 '22 16:01 skeeith

+1 When will the package be updated?

cristianm avatar Apr 04 '22 23:04 cristianm

+1 When will the package be updated?

joshuarussell76 avatar Apr 12 '22 20:04 joshuarussell76

+1

Suzan-Dev avatar Jul 25 '22 05:07 Suzan-Dev

+1

narendra-paiteq avatar Jul 20 '23 10:07 narendra-paiteq

@seanemmer

mohitharshan123 avatar Oct 07 '23 14:10 mohitharshan123

+1

tuguldur avatar Mar 05 '24 04:03 tuguldur