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

DISTINCT_SCAN produces incorrect results for nested arrays

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Integration

    Description

      db.u.drop()
      db.u.insert({"a" : [ [ 1, 2 ], 3 ]})
       
      db.u.distinct("a")
      // result: [ 3, [ 1, 2 ] ]
       
      db.u.createIndex({a: 1})
      db.u.distinct("a")
      // result: [ 1, 2, 3 ] -- the nested array [1, 2] got unwound but it shouldn't
      // the plan here is PROJECTION_COVERED over DISTINCT_SCAN
      

      Attachments

        Activity

          People

            backlog-query-integration Backlog - Query Integration
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: