Closed makersu closed 7 years ago
My solution: use updateAll instead.
Numessage.updateAll({_id:numessageInstance.id},data, function(err,obj){
if(err){
console.log(err)
}
console.log(obj)
cb(err, obj);
});
Ditto here! Any progress yet?
Folks, we are seeing this with MongoDB v 2.6.9, nodejs driver 1.4.38. Any solutions? Found similar posts: http://stackoverflow.com/questions/26405536/mongo-mongoid-exception-failed-with-error-not-master
I am also seeing the not master
error with mongo 3.0.3
and connector 1.8.0
:
{
"error": {
"name": "MongoError",
"status": 500,
"message": "not master",
"note": "from execCommand",
"ok": 0,
"errmsg": "not master"
}
}
datasources.json:
options: {
readPreference: 'secondaryPreferred',
replicaSet: 'replica-1',
},
+1 Any update?
@MrMMorris Will this work ? Will this actually use replicaset ? I see no way in the connector files where replicaSet is used. https://github.com/strongloop/loopback-connector-mongodb
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS
file at the top-level of this repository.
UpdateAttributes/upsert will cause MongoError due to update to secondary?
error message:
datasources.json:
numessage.js