when I run the code by "node app.js" command this error is showing
(node:2509) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
You need to pass { useNewUrlParser: true }
option to mongoose.connect() method. Your code should look similar to the snippet below.
mongoose.connect('mongodb://user:[email protected]:27017/dbname', { useNewUrlParser: true })