connecting to mongoose localhost code example
Example: mongoose connection to localhost
mongoose.connect('mongodb://localhost:27017/myapp', {useNewUrlParser: true});
mongoose.connect('mongodb://localhost:27017/myapp', {useNewUrlParser: true});