Skip to content

docs: document versioned api usage #2779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2021
Merged

Conversation

emadum
Copy link
Contributor

@emadum emadum commented Apr 7, 2021

Note: We'll probably want to have a shorter note about a versioned API in the CHANGES doc, and a link to the section in the official Node driver docs, once they have been updated with the versioned API usage examples here.


## Versioned API

Versioned API is a new feature in MongoDB 5.0 that allows user-selectable API versions, subsets of MongoDB server semantics, to be declared on a client. During communication with a server, clients with a declared API version will force the server to behave in a manner compatible with the API version. Declaring an API version on a client can be used to ensure consistent responses from a server, providing long term API stability for an application. The declared API version is applied to all commands run through the client, including those sent through the generic RunCommand helper. Specifying versioned API options in the command document AND declaring an API version on the client is not supported and will lead to undefined behaviour.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the right place, but maybe it’s worth mentioning that setting the option on a pre-5.0 server fails?

Co-authored-by: Anna Henningsen <github@addaleax.net>
@emadum emadum marked this pull request as ready for review April 9, 2021 12:35
@emadum emadum requested review from nbbeeken and durran April 9, 2021 12:36
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@emadum emadum merged commit 88996d9 into 4.0 Apr 27, 2021
@emadum emadum deleted the NODE-3059/document-versioned-api branch April 27, 2021 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants