-
Notifications
You must be signed in to change notification settings - Fork 984
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
Conversation
} else { | ||
document = mongoDatabase.runCommand(clientSession, new Document(command, 1)); | ||
document = mongoDatabase.runCommand(new Document(command, 1)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I refactor it.
CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder(); | ||
Document document; | ||
if (metricsParts.length == 1) { | ||
document = mongoDatabase.runCommand(clientSession, new Document(command, 1)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍LGTM
What's changed?
link #1692
Checklist
Add or update API