$query must be provided with $readPreference

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.3.0-rc0
    • Affects Version/s: 1.3.0-beta0
    • Component/s: libmongoc
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The driver can incorrectly send OP_QUERY to mongos with a read preference like:

      {$readPreference:{mode:'secondary'}}
      

      mongos 2.4 returns "BadValue: cannot canonicalize query". Later mongoses accept this format. Regardless, according to Server Selection Spec, if the query filter is empty it must be included anyway:

      {$query:{}, $readPreference:{mode:'secondary'}}
      

      This format works with all supported versions of mongos.

              Assignee:
              A. Jesse Jiryu Davis
              Reporter:
              A. Jesse Jiryu Davis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: