$push and $addToSet should have a $limit modifier

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • Query
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      I believe on top of $slice that lets you control the size of the resulting array, there should be a modifier that allows Mongo to return an error when the resulting array size would exceed a certain limit.

      $slice is nice when you can afford to lose the docs that didn't "make it" to the final array.

      $limit (or whatever we call it) would be nice because an application could capture an exception when updating an array with too many items and then act on it in a smarter way than just dropping some items (which $slice already provides).

            Assignee:
            Backlog - Query Team (Inactive)
            Reporter:
            Stefan Wójcik
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: