Docs Menu

Docs HomeMongoDB Manual

Migrate to a Later API Version

On this page

  • Compatibility with Future Versions

The only API version that currently exists is "1", but there will be new API versions released in the future. Upgrading your API version provides improved functionality and semantics for your application.

Some API V1 commands and behaviors will be deprecated in future versions of the MongoDB server. Deprecated commands and behaviors are typically not included in the next API version.

To migrate an existing application from API V1 to API V2, you must find and update all of the deprecated commands and behaviors features it uses.

client = MongoClient(
<connection string>,
api={"version": "1", "strict": True, "deprecationErrors": True}
)

The returns a APIDeprecationError if your application code tries to use commands and behaviors deprecated in API V1. Once your application tests pass and all deprecation errors have been fixed, you will be ready to test your application with API V2.

←  Stable APIStable API Changelog →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.