Percona operator auto detect primary node

mongosh “mongodb+srv://databaseAdmin:databaseAdminPassword@my-cluster-name-rs0..svc.cluster.local/admin?replicaSet=rs0&ssl=false”

Does this have ability to detect failover and route the applications to new Primary ?

It was sending my connection to Secondary.

rs0 [direct: secondary] admin> db.currentOp()
MongoServerError: not primary and secondaryOk=false - consider using db.getMongo().setReadPref() or readPreference in the connection string
rs0 [direct: secondary] admin>

How about to use “mongodb://” with option “directConnection=true”?
It always connect to primary node if non-sharding cluster.