任何人都可以解释在哪种情况下发生以下错误?MongoError:找不到有效的复制对象成员
database error {
[MongoError: no valid replicaset members found]
name: 'MongoError',
message: 'no valid replicaset members found'
}
这是我如何连接到副本集:
var url = format("mongodb://%s:%[email protected]%s/%s?authSource=%s&replicaSet=%s&readPreference=%s&readPreferenceTags=%s&connectTimeoutMS=%s&socketTimeoutMS=%s", username, pswd, replicationSet, db, authdb, replicaSetName, readPreference, readPreferenceTags, 5000, 5000);
var db = mongojs(url);
嗨Prabhu Kathiresan - 你得到这个错误?如果是这样,你能告诉我们你如何连接到副本集? –
var url = format(“mongodb://%s:%s @%s /%s?authSource =%s&replicaSet =%s&readPreference =%s&readPreferenceTags =%s&connectTimeoutMS =%s&socketTimeoutMS =%s”,username,pswd,replicationSet, db,authdb,replicaSetName,readPreference,readPreferenceTags,5000,5000); var db = mongojs(url); 这是我如何连接副本集 –
得到了什么? –