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

$setUnion returns values from second array instead of union

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.2.3
    • Querying
    • None
    • ALL
    • Hide

      execute script
      { $setUnion: { [ "a", "b", "c" ], [ "b", "a", "a", "d" ] }}
      or

      { $setUnion: [ "a", "b", "c" ], [ "b", "a", "a", "d" ] }
      Show
      execute script { $setUnion: { [ "a", "b", "c" ], [ "b", "a", "a", "d" ] }} or { $setUnion: [ "a", "b", "c" ], [ "b", "a", "a", "d" ] }

    Description

      When execute
      { $setUnion: { [ "a", "b", "c" ], [ "b", "a", "a", "d" ] }}
      or

      { $setUnion: [ "a", "b", "c" ], [ "b", "a", "a", "d" ] }

      either returns: "b", "a", "a", "d"

      1. union does not work. expected result for union should include: "c", "b", "a", "d"
      2. duplicated items do not removed from the result.

      Attachments

        Activity

          People

            mark.agarunov Mark Agarunov
            apetruc@gmail.com anatolii petruchok
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: