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

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

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.5.3
    • 2.5.3
    • None
    • Fully Compatible

    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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: