Error
Error Code: 115

MongoDB Error 115: Unsupported Command Executed

📦 MongoDB
📋

Description

This error indicates that the MongoDB server received a command it does not recognize or cannot execute. This typically occurs when a client attempts to use a command that is not supported by the current server version, configuration, or license.
💬

Error Message

Command Not Supported
🔍

Known Causes

4 known causes
⚠️
Unsupported MongoDB Version
The command being executed is only supported in a different, typically newer, version of MongoDB than the one currently running.
⚠️
Feature Not Enabled or Available
The command relies on a specific MongoDB feature (e.g., sharding, replication, specific storage engines) that is not enabled or available in the current deployment configuration.
⚠️
Invalid Command Syntax or Parameters
The command was issued with incorrect syntax, missing required parameters, or malformed arguments, making it unrecognizable by the server.
⚠️
Deprecated or Removed Command
Attempting to use a command that has been deprecated or removed in the current MongoDB server version, often due to significant architectural changes.
🛠️

Solutions

3 solutions available

1. Verify MongoDB Version Compatibility easy

Ensure the command you're executing is supported by your MongoDB version.

1
Identify the exact command you are trying to execute that resulted in Error 115.
2
Determine your currently installed MongoDB version. You can do this by connecting to your MongoDB instance using the `mongosh` shell and running the following command:
db.version()
3
Consult the official MongoDB documentation for your specific version. Search for the command you are using and verify its availability and syntax.
4
If the command is not supported in your current version, consider upgrading MongoDB to a version that supports the desired functionality, or find an alternative command or approach.

2. Check Client Driver Version medium

Ensure your application's MongoDB driver is compatible with your MongoDB server version.

1
Identify the MongoDB driver your application is using (e.g., Node.js driver, PyMongo, Java driver).
2
Determine the version of the MongoDB driver your application is currently using. This is typically found in your project's dependency management file (e.g., `package.json` for Node.js, `requirements.txt` for Python).
3
Refer to the release notes or documentation for your specific MongoDB driver. Check for compatibility matrices that map driver versions to supported MongoDB server versions.
4
If the driver version is outdated or incompatible, upgrade it to the latest stable version that supports your MongoDB server version. For example, if using Node.js:
npm install mongodb@latest
5
Rebuild and redeploy your application after updating the driver.

3. Use Supported Commands for Your MongoDB Deployment Type medium

Some commands are specific to standalone servers, replica sets, or sharded clusters.

1
Identify the type of your MongoDB deployment (standalone, replica set, or sharded cluster). You can often check this by connecting to `mongosh` and running `rs.status()` (for replica sets) or checking the configuration of your `mongod` processes.
2
Review the command you are executing. Some administrative commands, like certain `replSet` commands, are only valid on replica set members and will result in Error 115 if executed on a standalone `mongod` instance.
3
Consult the MongoDB documentation for the specific command. The documentation will usually specify which deployment types the command is applicable to.
4
If you are attempting to run a command that is only supported on a replica set or sharded cluster, and you are on a standalone instance, you will need to reconfigure your deployment or find an alternative method to achieve your goal.
🔗

Related Errors

5 related errors