Skip to content

Conversation

@idarowan
Copy link
Collaborator

@idarowan idarowan commented Aug 25, 2025

When connected to a secondary, detect whether the shell is mongosh.

  • For mongosh, set read preference to primaryPreferred to avoid deprecation warnings.
  • For legacy shell, continue to use rs.secondaryOk() if available.
  • Remove fallback to slaveOk() and throw explicit error if secondary reads cannot be enabled.

This ensures compatibility with mongosh while preserving legacy shell support. MIGRATION-467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant