use new url parser in mongodb code example
Example: To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect
MongoClient.connect("mongodb://localhost:27017/YourDB", { useNewUrlParser: true })
MongoClient.connect("mongodb://localhost:27017/YourDB", { useNewUrlParser: true })