-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Write Ops
-
None
-
Query
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).