Your Connection URL is without a port number, add the port number to the URL
mongodb://localhost:27017/subscribers
MongoDB - default port number is 27017
https://docs.mongodb.com/manual/reference/default-mongodb-port/
https://mongoosejs.com/docs/connections.html#connections
You can connect to MongoDB with the mongoose.connect() method.
mongoose.connect('mongodb://localhost:27017/myDB', {useNewUrlParser: true}); This is the minimum needed to connect the myapp database running locally on the default port (27017). If connecting fails on your machine, try using 127.0.0.1 instead of localhost.
You can also specify several more parameters in the uri:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.