Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1092

cursor.explain not using correct default verbosity level when connecting to ADL

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: Shell API
    • Labels:
      None
    • Environment:
      I'm on macos using version 1.1.7 of mongosh.
    • Needed
    • Hide

      mongosh aligns the default verbosity of cursor.explain() with the driver and the command rather than the currently documented shell behavior, i.e. we are passing allPlansExecution instead of queryPlanner by default.

      Show
      mongosh aligns the default verbosity of cursor.explain() with the driver and the command rather than the currently documented shell behavior, i.e. we are passing allPlansExecution instead of queryPlanner by default.

      Problem Statement/Rationale

      When I connect to Atlas Data Lake (both locally and in our dev environment) and issue the following command:

      db.coll.find({a: 1}).explain()

      It generates an explain command with a verbosity level of: "allPlansExecution". This is the BSON doc we get for the command:

      {"explain": {"find": "coll","filter": {"a": {"$numberInt":"1"}}},"verbosity": "allPlansExecution","lsid": {"id": {"$binary":{"base64":"ed4DRneUSC2vxB5Kd+CwSw==","subType":"04"}}},"$db": "test"}

      This is problematic for Data Lake, because we do not support allPlansExecution.

      According to the docs: https://docs.mongodb.com/manual/reference/method/cursor.explain/ the default verbosity level should be "queryPlanner"

      Steps to Reproduce

      See above. Note: I was not able to repro this on the server. Mongosh seemed to be using the correct verbosity level when running against the server.

      Expected Results

      Mongosh should use the "queryPlanner" verbosity level by default when connected to ADL instance if necessary.

      Actual Results

      Mongosh is sending a command doc with the verbosity level: allPlansExecution

      Additional Notes

      I asked about this in #mongosh: https://mongodb.slack.com/archives/CUHC9R8J0/p1641342447132900

      and was told to a file a ticket. I'm happy to help an engineer from the mongosh connect to an ADL if necessary.

            Assignee:
            Unassigned Unassigned
            Reporter:
            brian.deleonardis@mongodb.com Brian DeLeonardis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: