[SERVER-10988] Support $slice from middle for $push Created: 01/Oct/13  Updated: 06/Dec/22  Resolved: 29/Jun/19

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-8069 Support full $slice / $sort semantics... Closed
is related to SERVER-11210 $addToSet missing $position and $slic... Closed
is related to SERVER-4798 $pop multiple elements from an array ... Closed
Assigned Teams:
Query
Participants:

 Description   

Currently you can $slice from either end of the array using positive or negative numbers but cannot take from the middle.



 Comments   
Comment by Asya Kamsky [ 29/Jun/19 ]

SERVER-40381 implemented support for aggregation expressions to specify update for 4.2. 

You can see some examples here.

This can be done by setting the array to its new value using aggregation expression $slice.

Comment by Asya Kamsky [ 28/Dec/16 ]

I'm not clear on how this would work. If this means middle as expressed using size of array, then SERVER-27089 will help.

Generated at Thu Feb 08 03:24:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.