[SERVER-8289] Multiple $sort on fixed size array causes wrong/duplicate elements Created: 23/Jan/13  Updated: 08/Mar/13  Resolved: 23/Jan/13

Status: Closed
Project: Core Server
Component/s: None
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, $sort:

{a:1}

, $sort:

{a:-1}

} } })

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

{ "a" : 3 }

,

{ "a" : 2 }

,

{ "a" : 2 }

,

{ "a" : 1 }

] }

Participants:

 Description   

Using $push with $slice and $sort causes the wrong elements to be stored in the fixed size array.



 Comments   
Comment by Sam Weaver [ 23/Jan/13 ]

Data problem, not a bug.

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