Give a helpful error when test APIs are accessed without enableTestCommands.

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • QE 2025-05-12, QE 2025-05-26, QE 2025-06-09
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-88630 confused several people until it was realized that the failure's cause was that enableTestCommands was disabled.

      This ticket proposes that, instead of:

      Unrecognized expression '$_testApiVersion'
      

      ... the server should give an error like:

      Expression '$_testApiVersion' is for MongoDB's internal testing only.
      

      This will deter external users appropriately, and folks who—like me —actually need to use it will know to ask in an appropriate forum, "how can I use internal-testing controls like $_testApiVersion?"

      (The message could additionally actually say that enableTestCommands is the setting to enable, but that may make it too easy for users to hurt themselves.)

            Assignee:
            Niels Lohmann
            Reporter:
            Felipe Gasper
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: