Answers for "(node:28212) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. (Use `node --trace-deprecation ...` to show where the warning was created)"

1

(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
  })
Posted by: Guest on February-26-2021
0

(node:2736) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.

mongoose.connect(
  url,
  {useCreateIndex: true },
  () => {
    console.log("MongoDB is connected!");
  }
);
Posted by: Guest on February-24-2021

Code answers related to "(node:28212) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. (Use `node --trace-deprecation ...` to show where the warning was created)"

Code answers related to "Javascript"

Browse Popular Code Answers by Language