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

mongocryptd does not include server API fields in explain command response

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.3, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Minor Change
    • ALL
    • v5.0
    • Security 2021-08-23

      mongocryptd does not echo back server API fields for "explain" command:

      var findCmd = {
          "find": "default",
          "filter": {
              "encrypted_string": "string1"
          },
          "apiVersion": "1",
          "jsonSchema": {},
          "isRemoteSchema": true
      }
      var explainCmd = {
          "explain": {
              "find": "default",
              "filter": {
                  "encrypted_string": "string1"
              }
          },
          "apiVersion": "1",
          "jsonSchema": {},
          "isRemoteSchema": true
      }
      print ("output of find:")
      printjson (db.runCommand(findCmd))
      print ("output of explain:")
      printjson (db.runCommand(explainCmd))
      

      Results in:

      output of find:
      {
              "hasEncryptionPlaceholders" : false,
              "schemaRequiresEncryption" : false,
              "result" : {
                      "find" : "default",
                      "filter" : {
                              "encrypted_string" : {
                                      "$eq" : "string1"
                              }
                      },
                      "apiVersion" : "1",
                      "lsid" : {
                              "id" : UUID("4f77d319-e271-4ab1-8f10-8d830c27b777")
                      }
              },
              "ok" : 1
      }
      output of explain:
      {
              "hasEncryptionPlaceholders" : false,
              "schemaRequiresEncryption" : false,
              "result" : {
                      "explain" : {
                              "find" : "default",
                              "filter" : {
                                      "encrypted_string" : {
                                              "$eq" : "string1"
                                      }
                              }
                      },
                      "verbosity" : "allPlansExecution"
              },
              "ok" : 1
      }
      

      The "find" command response contains "apiVersion" field but it's missing from "explain" response.

            Assignee:
            sara.golemon@mongodb.com Sara Golemon
            Reporter:
            mikalai.mazurenka@mongodb.com Mikalai Mazurenka (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: