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

$setUnion returns values from second array instead of union

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.3
    • Component/s: 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" ] }

      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.

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

              Created:
              Updated:
              Resolved: