MongoDB Stable API
Starting from version 5, MongoDB introduced the Stable API. 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 the mongosh shell, in a similar fashion to the following mongosh example:
--apiVersion 1
Note
1 is the only API version available as of MongoDB 6.0.
StableAPI
guarantees backward compatibility between MongoDB server upgrades.
This means that we can continue upgrading our MongoDB server without any significant risk that our application connected to the MongoDB server will behave differently.
This guarantee holds correct under the following three constraints:
- We need to declare
apiVersion
in the client - We need to use a supported version of the official MongoDB client
- We can only use commands and features that are supported in this API version
Following the third constraint, as of apiVersion=1
, we can only use any of...