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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.6.0-rc0
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
      }
      

            Assignee:
            Benety Goh
            Reporter:
            Jonathan Abrahams (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: