以下mongodb插入操作会出错:
db.dumpset.insert( { id: "xyz", status: "A" }, { writeConcern: { w: "activeNodes" } } )
WriteResult({
"nInserted" : 1,
"writeConcernError" : {
"code" : 100,
"errmsg" : "Not enough nodes match write concern mode \"activeNodes\""
}
})
副本集中有3个节点标有production
,自定义writeConcern如下所示:
"getLastErrorModes" : {
"activeNodes" : {
"production" : 3
}
}
MongoDB版本3.2.11,有什么遗漏?