[SERVER-11115] Inspecting db.collection.aggregate() shows hardcoded test checks Created: 09/Oct/13  Updated: 11/Jul/16  Resolved: 10/Oct/13

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

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Participants:

 Description   

When using the shell from todays master and "introspecting" the aggregation helper (leaving out the parenthesis) exposes a weird looking comment that feels creepy.

> db.messages.aggregate
function (pipeline, extraOpts) {
    var cmd = {pipeline: pipeline};
 
....
    if (TestData && !('batchSize' in cmd.cursor)) {
        // If we are running in a test, set batchsize to 0 to make sure it works across a GetMore
        cmd.cursor.batchSize = 0;
    }
....
}

Exposing normal users to this comment, and global variable test (who knows, maybe the user is using that variable for his own tests), feels very wrong and dirty.



 Comments   
Comment by auto [ 10/Oct/13 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-11115 Remove extra test code aggregate() shell helper
Branch: master
https://github.com/mongodb/mongo/commit/9a37b9f48505fb49604c6d9b99f448a18d524969

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