(node:3168) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. (Use `node --trace-deprecation ...` to show where the warning was created)
mongoose.set('useCreateIndex', true);
(node:3168) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. (Use `node --trace-deprecation ...` to show where the warning was created)
mongoose.set('useCreateIndex', true);
(node:14800) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. (Use `node --trace-deprecation ...` to show where the warning was created)
mongoose
.connect(process.env.DB_CONNECTION, {
useNewUrlParser: true,
useUnifiedTopology: true,
dbName: "business",
useCreateIndex: true
})
(node:2496) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
/*As of this edit, Mongoose is now at v5.4.13. Per their docs, these are the fixes for the deprecation warnings..*/
mongoose.set('useNewUrlParser', true);
mongoose.set('useFindAndModify', false);
mongoose.set('useCreateIndex', true);
(node:2736) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
mongoose.connect(
url,
{useCreateIndex: true },
() => {
console.log("MongoDB is connected!");
}
);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us