Unallowed argument in listDatabases command: filter

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • No version
    • Affects Version/s: 1.43.0
    • Component/s: None
    • None
    • Environment:
      OS: MacOS 14.4.1(23E224)
      Compass version: Version 1.43.0 (1.43.0)
      Additional info:
    • Not Needed
    • None
    • Developer Tools

      Problem Statement/Rationale

       

      I'm using altas with MongoDB Compass

      I run below commands in Compass MongoSh

      ```

      use admin

      db.adminCommand({listDatabases: 1, filter: {name: /^foo/}});

      ```

      then I got below error

      ```[MongoServerError[AtlasError]:|#] Unallowed argument in listDatabases command: filter
      at Connection.sendCommand (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:829176) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Connection.command (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:829989) at async Server.command (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:1042985) at async t.executeOperation (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:992204) at async CompassServiceProvider.runCommandWithCheck (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:184255) at async Proxy.adminCommand (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:271109) at async Proxy.adminCommand (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:315105) at async Proxy.<anonymous> (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:309716) at async evalmachine.<anonymous>:72:25 at async ShellEvaluator.innerEval (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:462420) at async ShellEvaluator.customEval (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:462688) at async OpenContextRuntime.evaluate (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:68564) at async ElectronRuntime.evaluate (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:134:69976) at async evaluate (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:1322747) at async /Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:1318710
      ```

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      ```

      _{"t":\{"$date":"2024-05-11T08:03:37.171Z"},"s":"I","c":"MONGOSH","id":1000000007,"ctx":"repl","msg":"Evaluating input","attr":\{"input":"db.adminCommand({listDatabases: 1, filter: {name: /^foo/}});"}}_
      _{"t":\{"$date":"2024-05-11T08:03:37.171Z"},"s":"I","c":"MONGOSH","id":1000000007,"ctx":"repl","msg":"Evaluating input","attr":\{"input":"db.adminCommand({listDatabases: 1, filter: {name: /^foo/}});"}}_
      _{"t":\{"$date":"2024-05-11T08:03:37.171Z"},"s":"I","c":"MONGOSH","id":1000000011,"ctx":"shell-api","msg":"Performed API call","attr":\{"method":"adminCommand","class":"Database","db":"admin","arguments":{"cmd":{"listDatabases":1,"filter":{"name":{}}}}}}_
      _{"t":\{"$date":"2024-05-11T08:03:37.172Z"},"s":"I","c":"MONGOSH","id":1000000011,"ctx":"shell-api","msg":"Performed API call","attr":\{"method":"adminCommand","class":"Database","db":"admin","arguments":{"cmd":{"listDatabases":1,"filter":{"name":{}}}}}}_
      _{"t":\{"$date":"2024-05-11T08:03:37.172Z"},"s":"I","c":"MONGOSH","id":1000000011,"ctx":"shell-api","msg":"Performed API call","attr":\{"method":"getSiblingDB","class":"Database","db":"admin","arguments":{"db":"admin"}}}_
      _{"t":\{"$date":"2024-05-11T08:03:37.172Z"},"s":"I","c":"MONGOSH","id":1000000011,"ctx":"shell-api","msg":"Performed API call","attr":\{"method":"getSiblingDB","class":"Database","db":"admin","arguments":{"db":"admin"}}}_
      _{"t":\{"$date":"2024-05-11T08:03:37.324Z"},"s":"I","c":"MONGOSH","id":1000000007,"ctx":"repl","msg":"Evaluating input","attr":\{"input":"(() => {\n        switch (typeof prompt) {\n          case 'function':\n            return prompt();\n          case 'string':\n            return prompt;\n        }\n      })()"}}_
      _{"t":\{"$date":"2024-05-11T08:03:37.324Z"},"s":"I","c":"MONGOSH","id":1000000007,"ctx":"repl","msg":"Evaluating input","attr":\{"input":"(() => {\n        switch (typeof prompt) {\n          case 'function':\n            return prompt();\n          case 'string':\n            return prompt;\n        }\n      })()"}}_
      _{"t":\{"$date":"2024-05-11T08:03:56.883Z"},"s":"I","c":"MONGOSH","id":1000000008,"ctx":"shell-api","msg":"Used \"use\" command","attr":\{"db":"admin"}}_
      _{"t":\{"$date":"2024-05-11T08:03:56.889Z"},"s":"I","c":"MONGOSH","id":1000000008,"ctx":"shell-api","msg":"Used \"use\" command","attr":\{"db":"admin"}}_
      _{"t":\{"$date":"2024-05-11T08:03:56.922Z"},"s":"I","c":"MONGOSH","id":1000000007,"ctx":"repl","msg":"Evaluating input","attr":\{"input":"(() => {\n        switch (typeof prompt) {\n          case 'function':\n            return prompt();\n          case 'string':\n            return prompt;\n        }\n      })()"}}_
      _{"t":\{"$date":"2024-05-11T08:03:56.922Z"},"s":"I","c":"MONGOSH","id":1000000007,"ctx":"repl","msg":"Evaluating input","attr":\{"input":"(() => {\n        switch (typeof prompt) {\n          case 'function':\n            return prompt();\n          case 'string':\n            return prompt;\n        }\n      })()"}}_
      _{"t":\{"$date":"2024-05-11T08:03:57.306Z"},"s":"I","c":"MONGOSH","id":1000000004,"ctx":"connect","msg":"Connecting to server","attr":\{"session_id":"","userId":null,"telemetryAnonymousId":null,"connectionUri":"mongodb+srv://eliamo:<email>/admin?authSource=admin&replicaSet=atlas-e5y1lc-shard-0&readPreference=primary&ssl=true&appName=MongoDB+Compass","is_atlas":true,"is_localhost":false,"is_do":false,"server_version":"7.0.8","node_version":"v20.9.0","mongosh_version":"2.2.3","server_os":null,"server_arch":null,"is_enterprise":true,"auth_type":"DEFAULT","is_data_federation":false,"is_stream":false,"dl_version":null,"atlas_version":"20240417.0.0.1713345559","is_genuine":true,"non_genuine_server_name":"mongodb","is_local_atlas":false,"fcv":null,"api_version":null,"api_strict":null,"api_deprecation_errors":null}}_
      _{"t":\{"$date":"2024-05-11T08:03:57.306Z"},"s":"I","c":"MONGOSH","id":1000000004,"ctx":"connect","msg":"Connecting to server","attr":\{"session_id":"","userId":null,"telemetryAnonymousId":null,"connectionUri":"mongodb+srv://eliamo:<email>/admin?authSource=admin&replicaSet=atlas-e5y1lc-shard-0&readPreference=primary&ssl=true&appName=MongoDB+Compass","is_atlas":true,"is_localhost":false,"is_do":false,"server_version":"7.0.8","node_version":"v20.9.0","mongosh_version":"2.2.3","server_os":null,"server_arch":null,"is_enterprise":true,"auth_type":"DEFAULT","is_data_federation":false,"is_stream":false,"dl_version":null,"atlas_version":"20240417.0.0.1713345559","is_genuine":true,"non_genuine_server_name":"mongodb","is_local_atlas":false,"fcv":null,"api_version":null,"api_strict":null,"api_deprecation_errors":null}}_
      

      ```

      Steps to Reproduce

      How could an engineer replicate the issue you're reporting?

      use Compass to connect to a altas

      run below commands in MongoSH

      ```

      use admin

      db.adminCommand({listDatabases: 1, filter: {name: /^foo/}});

      ```

      Expected Results

      get a list of databases match the input filter

      Actual Results

      I got an error

      Additional Notes

      Any additional information that may be useful to include.

            Assignee:
            Betsy Button
            Reporter:
            リン リン
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: