Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11115

Inspecting db.collection.aggregate() shows hardcoded test checks

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.3
    • Affects Version/s: 2.5.3
    • Component/s: None
    • Fully Compatible

      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.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: