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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.7.0
    • None
    • Querying, Shell
    • None
    • Minor Change
    • Query 2020-03-23, Query 2020-05-18

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: