Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-46903

Ensure mongo shell respects readPreference for $out and $merge when 'Mongo.setReadPref' is called

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Querying, Shell
    • None
    • Minor Change
    • Query 2020-03-23, Query 2020-05-18

      When Mongo.setReadPref('secondary') is called from the mongo shell when connected to a secondary, an aggregate with $out/$merge errors with 'NotMasterNoSlaveOk' and doesn't run. The only way to get this to work is to use the legacy 'Mongo.setSlaveOk(true)'.

      Update Mongo.setReadPref() to respect the specified readPreference.

            Assignee:
            mihai.andrei@mongodb.com Mihai Andrei
            Reporter:
            mihai.andrei@mongodb.com Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: