$addToSet group operator should maintain insert order

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently uses an unordered_set<>. Needs to maintain insert order so a pipeline like this has the original comment order:

      db.posts.aggregate(
          {$unwind: 'comments'},
          {$match: {'comments.deleted': {$ne: true}}},
          {$group: {_id: '$_id', comments: {$addToSet: '$comments'}}}
      );
      

            Assignee:
            Unassigned
            Reporter:
            Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: