strange mongodb and mongoose error: not master and slaveOk=false error

后端 未结 5 1288
忘掉有多难
忘掉有多难 2020-12-30 19:34

I\'m getting a strange error in my node.js app

not master and slaveOk=false code 13435

I\'m doing a findOne query using mongoose 4.0.2 hitting a

5条回答
  •  渐次进展
    2020-12-30 20:27

    This works for me on mongoose 4.x and mongodb 3.0.x:

    model.find().read('secondary').....
    

    see http://mongoosejs.com/docs/api.html#query_Query-read

提交回复
热议问题