mongoose
mongoose copied to clipboard
mongoose : replica set , Error message ::: no primary found in replicaset or invalid replica set name
mongoose version : 5.3.0
cont mongoose = require('mongoose')
mongoose.connect('mongodb://localhost:27017,localhost:27017,localhost:27017/test?replicaSet=rsName', {useNewUrlParser:true, });
error message : no primary found in replicaset or invalid replica set name
I want to duplicate. Yes I followed it correctly and I get an error. What is the problem?
Why do you have 'localhost:27017' repeated 3 times? You need 3 distinct host/port combinations. Also, can you connect with the mongodb shell?