[SERVER-32300] Aggregation shell helper should not modify options document Created: 13/Dec/17  Updated: 30/Oct/23  Resolved: 05/Mar/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Improvement Priority: Minor - P4
Reporter: Kyle Suarez Assignee: Charlie Swanson
Resolution: Fixed Votes: 1
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

When running this code:

let collation = {collation: {locale: "fr", backwards: true}};
db.collection.explain().aggregate([], collation);

The collation document is modified to also have an explain: true field. This is really annoying, because it means I can't use the same options document in multiple commands if an explain is interspersed between them.

Seems like the bug is in the explain part of the shell code, as db._runAggregate() explicitly makes a copy of the options doc to avoid changing the input parameter.



 Comments   
Comment by Githook User [ 05/Mar/18 ]

Author:

{'email': 'dandanlin.l@gmail.com', 'name': '“Dandan', 'username': 'Dandanlin0702'}

Message: SERVER-32300 Explainable.aggregate should not modify options argument.

Closes #1219
Signed-off-by: Charlie Swanson <charlie.swanson@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/120aed6254ff814a351f99d4e243a1510286ffb0

Comment by Charlie Swanson [ 26/Feb/18 ]

I'm working with the Pull Request's author (Dandan) as part of a CUNY Tech Prep course, assigning to myself.

Generated at Thu Feb 08 04:29:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.