[SERVER-8290] Multiple $slice on fixed sized array causes wrong/duplicate elements Created: 23/Jan/13  Updated: 07/Mar/14  Resolved: 23/Jan/13

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

Type: Bug Priority: Major - P3
Reporter: Sam Weaver Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

db.fs.update(

{x:4}

,{ $push : { y : { $each : [

{a:5}

,

{a:1}

,

{a:4}

,

{a:2}

,

{a:3}

], $slice:-4, $slice:-3, $sort:

{a:1}

} } })

db.fs.find()
{ "_id" : ObjectId("50fd0989a8f4e3eef998f845"), "x" : 4, "y" : [

{ "a" : 4 }

,

{ "a" : 4 }

,

{ "a" : 5 }

] }

Participants:

 Description   

Doing a $push with multiple $slice for fixed sized arrays causes wrong/duplicate elements.


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