Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-701

Got Error "unknown m/r field for sharding: $readPreference" when querying a sharded cluster

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major - P3 Major - P3
    • None
    • 2.10.0
    • None
    • Scientific Linux 6.2 (Carbon)

    Description

      I have recently setup a sharded cluster, but the shards are actually single nodes. The problem I'm having is that when I query the `mongos` instance, reusing some code I know works against a single node I get:

      Exception in thread "main" com.mongodb.CommandResult$CommandFailure: command failed [mapreduce]:

      { "serverUsed" : "project11.cs.st-andrews.ac.uk/138.251.214.135:27017" , "ok" : 0.0 , "errmsg" : "unknown m/r field for sharding: $readPreference"}

      Note: I was performing an aggregate using the new aggregate framework.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chutsu Chris Choi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: