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

Distinct: cursor is empty for $or query with hashed index

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.6.0-rc0
    • None
    • Querying
    • None
    • Fully Compatible
    • ALL

    Description

      Cursor is null for hashed index for $or query:

      > t.runCommand( "distinct" , { key : "a" , query : {$or: [{a:3}, {a:5}] }} );
      {
          "values" : [
              3,
              5
          ],
          "stats" : {
              "n" : 20000,
              "nscanned" : 100000,
              "nscannedObjects" : 100000,
              "timems" : 73,
              "cursor" : "BasicCursor"
          },
          "ok" : 1
      }
      > t.ensureIndex({a: "hashed"});
      > t.runCommand( "distinct" , { key : "a" , query : {$or: [{a:3}, {a:5}] }} );
      {
          "values" : [
              3,
              5
          ],
          "stats" : {
              "n" : 20000,
              "nscanned" : 20000,
              "nscannedObjects" : 20000,
              "timems" : 55,
              "cursor" : ""
          },
          "ok" : 1
      }

      Attachments

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: