(node:19012) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead. (Use `node --trace-deprecation ...` to show where the warning was created) code example

Example 1: https://mongoosejs.com/docs/deprecations.html#findandmodify

// Make Mongoose use `findOneAndUpdate()`. Note that this option is `true`
// by default, you need to set it to false.
mongoose.set('useFindAndModify', false);

Example 2: deprecationwarning: mongoose

mongoose.connect("mongodb://localhost/test1", { useNewUrlParser: true, useUnifiedTopology: true });
//test1 is databse name