Trying to get results of command that I passed in admin command, but it throws me back a MongoError:not master and slaveOk=false
the commands work fine on shell after setting rs.slaveOk().
how to / where to set rs.slaveOk() using mongoose library, if it is?
conn = mongoose.createConnection(`mongodb://localhost:port`)
cmd = "someCommand"
conn.db.admin().command(cmd, (err, result)=>{
if(err){
console.error(err)
}
resolve(result)
})
// MongoError: not master and slaveOk=false