MongoDB Stable API
Introduced in MongoDB 5.0, the Stable API provides a guarantee that the API will not break for client-server communication. The Stable API is declared when using any driver or mongosh
, in a similar fashion to the following mongosh
example:
mongosh --apiVersion 1
Note
1
is the only API version available as of MongoDB 7.0.
StableAPI
guarantees backward compatibility between MongoDB server upgrades. This means that you can continue upgrading your MongoDB server without any significant risk, i.e., your application connected to the MongoDB server will behave differently.
This guarantee holds correct under the following three constraints:
- You need to declare
apiVersion
in the client - You need to use a supported version of the official MongoDB client
- You can only use commands and features that are supported in this API version
Following the third constraint, as of apiVersion='1'
, you can use any of the following commands: