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

Divide ClientUpdateOptions and ClientDeleteOptions #1593

Open
wants to merge 22 commits into
base: JAVA-4586_bulk-write
Choose a base branch
from

Conversation

vbabanin
Copy link
Member

@vbabanin vbabanin commented Jan 6, 2025

This PR adds BaseClientUpdateOptions and BaseClientDeleteOptions as shared base interfaces for their respective client option types. While duplication of methods in sub-interfaces is still required, this approach ensures a more error-resistant API evolution.

JAVA-5737

@vbabanin vbabanin requested a review from stIncMale January 7, 2025 00:54
JAVA-5737
@vbabanin vbabanin self-assigned this Jan 7, 2025
@vbabanin vbabanin marked this pull request as ready for review January 7, 2025 06:42
stIncMale added a commit to stIncMale/mongo-java-driver that referenced this pull request Jan 7, 2025
stIncMale added a commit to stIncMale/mongo-java-driver that referenced this pull request Jan 7, 2025
stIncMale added a commit to stIncMale/mongo-java-driver that referenced this pull request Jan 8, 2025
stIncMale added a commit to stIncMale/mongo-java-driver that referenced this pull request Jan 8, 2025
stIncMale added a commit to stIncMale/mongo-java-driver that referenced this pull request Jan 8, 2025
Comment on lines +30 to +34
BaseClientDeleteOptions collation(@Nullable Collation collation);

BaseClientDeleteOptions hint(@Nullable Bson hint);

BaseClientDeleteOptions hintString(@Nullable String hintString);
Copy link
Member

Choose a reason for hiding this comment

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

[optional]

  1. These three methods seem to be shared by all options, including replace options. It seems trivial to add BaseClientWriteModelOptions that declares them, and is a super-interface for BaseClientDeleteOptions, BaseClientUpdateOptions, ClientReplaceOptions.
  2. upsert is shared by BaseClientUpdateOptions and ClientReplaceOptions. Do you think it makes sense to add something like BaseClientUpsertableWriteModelOptions, such that it's a supertype for BaseClientUpdateOptions and ClientReplaceOptions?

driver-core/src/test/unit/com/mongodb/MongoAssertions.java Outdated Show resolved Hide resolved
@vbabanin vbabanin requested a review from stIncMale January 9, 2025 00:20
vbabanin and others added 4 commits January 8, 2025 18:36
…ncreteClientUpdateOneModel.java

Co-authored-by: Valentin Kovalenko <[email protected]>
…ncreteClientUpdateManyModel.java

Co-authored-by: Valentin Kovalenko <[email protected]>
JAVA-5737
@vbabanin vbabanin requested a review from stIncMale January 9, 2025 02:45
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.

2 participants