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

$push and $addToSet should have a $limit modifier

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Gone away
    • None
    • None
    • Write Ops
    • None

    Description

      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).

      Attachments

        Activity

          People

            backlog-server-query Backlog - Query Team (Inactive)
            wojcikstefan Stefan Wójcik
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: