-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Iteration Reno, Iteration Seoul, Iteration Versailles
It's not clear to me what the "non-deprecated" way is from the warning message
replset [direct: secondary] test> rs.secondaryOk() DeprecationWarning: .setSecondaryOk() is deprecated. Use .setReadPref("primaryPreferred") instead Setting read preference from "primary" to "primaryPreferred"
especially since I didn't run .setSecondaryOk().
I followed the various tickets (MONGOSH-568 MONGOSH-910) and it looks like the correct thing to do is
db.getMongo().setReadPref('primaryPreferred')
Aside from the fact that this requires me to type a string (instead of using tab complete) which is annoying, setReadPref is not actually an option for db.getMongo().s<tab>
replset [direct: secondary] test> db.getMongo().set db.getMongo().setImmediate db.getMongo().setInterval db.getMongo().setTimeout
So there are two requests in this ticket:
- Are we committed to deprecating rs.secondaryOk() and making users type approximately 5x as many characters to achieve the same thing?
- In the mongo shell you can type rs.se<tab>) (7 characters)
- If so, can we make setReadPref tab completable?
- is duplicated by
-
MONGOSH-1056 DeprecationWarning setSecondaryOk() is deprecated provides confusing output
- Closed