Reputation: 57
I am able to add a user to systems.users collection when I register from primary node, But when I add a user from secondary node, value is not getting updated in the primary and so the replication fails, primary is in US and secondary is in Europe.
var user = { user: email, pwd: password, roles: [ { role: "readWrite", db: "newUser" } ] }; db.addUser(user); res.send('added');
Am I missing anything?
Upvotes: 0
Views: 88
Reputation: 1580
As mkorszun wrote, every write operation MUST be done at primary. You can of course read from secondary, if you set slaveOk=true.
Upvotes: 1