Distinct: Empty query on hashed index returns bad result

XMLWordPrintableJSON

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

      Result from distinct for empty query with a hashed index is incorrect:

      > t.distinct('a', {})
      [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
      > t.ensureIndex(

      {a: "hashed"}

      );
      > t.distinct('a', {})
      [
      NumberLong("-6504342592125989714"),
      NumberLong("-6200100076853976706"),
      NumberLong("-1529429926180645992"),
      NumberLong("848411777775835583"),
      NumberLong("2433984061343616404"),
      NumberLong("4470791281878691347"),
      NumberLong("4854801880128277513"),
      NumberLong("5902408780260971510"),
      NumberLong("6497670140411665948"),
      NumberLong("9174449368162552349")
      ]
      > t.distinct('a',

      {a: 3}

      )
      [ 3 ]

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

              Created:
              Updated:
              Resolved: