Skip to content
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

[fix] Compatible with MongoDB versions earlier than 3.6 #1988

Merged
merged 4 commits into from
May 15, 2024

Conversation

gjjjj0101
Copy link
Contributor

What's changed?

link #1692

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

} else {
document = mongoDatabase.runCommand(clientSession, new Document(command, 1));
document = mongoDatabase.runCommand(new Document(command, 1));
Copy link
Member

Choose a reason for hiding this comment

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

Why not combine lines 123 and 125 into one line and put it outside the if statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I refactor it.

@tomsun28 tomsun28 added the good first pull request Good for newcomers label May 14, 2024
CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder();
Document document;
if (metricsParts.length == 1) {
document = mongoDatabase.runCommand(clientSession, new Document(command, 1));
Copy link
Contributor

Choose a reason for hiding this comment

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

hi, if do not use clientSession close, is the mongoDatabase will auto close the seesion after run command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mongoDatabase is used to encapsulate the functions for users to operate the database, and construct the real execution options and hand it over to mongoClient for execution, so it does not need to close.

Copy link
Contributor

@tomsun28 tomsun28 left a comment

Choose a reason for hiding this comment

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

👍LGTM

@tomsun28 tomsun28 merged commit 1dbfc2b into apache:master May 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants