count helper doesn't apply read preference

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.2.6, 3.3.0
    • Affects Version/s: 3.2.0
    • Component/s: Shell
    • Environment:
      Debian 7
    • Fully Compatible
    • Linux
    • Hide

      mongo XXX.XXX.XXX.XXX:XXXX
      db.getMongo().setReadPref('secondary');
      use XXXX;
      db.getMongo().setReadPref('secondary');
      db.XXX.find().count();

      Show
      mongo XXX.XXX.XXX.XXX:XXXX db.getMongo().setReadPref('secondary'); use XXXX; db.getMongo().setReadPref('secondary'); db.XXX.find().count();
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I setup a v3.2 mongos with 3 shards and 3 replica for each shard.

      But from shell, no matter I set readpref to 'secondary' or 'secondarypreferred', my query always go to primary.

      I haven't tried other api like java, etc.

      By the way, when I miss-spell the mode, it doesn't tell me an error.

              Assignee:
              Adam Midvidy (Inactive)
              Reporter:
              Hoyt Ren
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: