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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.5.3
    • Fix Version/s: 2.5.3
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      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

            Assignee:
            redbeard0531 Mathias Stearn
            Reporter:
            bjori Hannes Magnusson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: