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

Add suport for replaceOne operation #4462

Closed
jakubwladyslaw opened this issue Jul 30, 2023 · 3 comments
Closed

Add suport for replaceOne operation #4462

jakubwladyslaw opened this issue Jul 30, 2023 · 3 comments
Labels
type: enhancement A general enhancement

Comments

@jakubwladyslaw
Copy link
Contributor

Spring Data mongoDB doesn't support replaceOne, but mongoDB driver support it.
https://www.mongodb.com/docs/manual/reference/method/db.collection.replaceOne/

@christophstrobl
Copy link
Member

Thank you @jakubwladyslaw for getting in touch. Before we add another method (plus overloads) to MongoOperations and potentially ReactiveMongoOperations please tell us a little more about the issue that it solves. Like, why is the existing save method not sufficient.

@christophstrobl christophstrobl added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 31, 2023
@jakubwladyslaw
Copy link
Contributor Author

Save works well when i have id, but in my case id could change.
Without replace i can use findAndReplace, but this method fetch Document from mongodb unnecessary.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jul 31, 2023
@christophstrobl
Copy link
Member

Thanks @jakubwladyslaw - fair enough, we'll take if from here.

@christophstrobl christophstrobl added type: enhancement A general enhancement and removed status: feedback-provided Feedback has been provided labels Aug 14, 2023
christophstrobl added a commit that referenced this issue Sep 11, 2023
...and update the documentation.

See: #4462
Original Pull Request: #4463
christophstrobl pushed a commit that referenced this issue Sep 11, 2023
Consistently use Document instead of record. Reformat code. Tweak documentation wording.

See: #4462
christophstrobl added a commit that referenced this issue Sep 11, 2023
…reactive api variant.

Narrow the scope of exposed methods on MongoOperations interface. The broader replace API variant has been moved to a protected method allowing users to hook into the implementation and (if needed) expose it.

See: #4462
Original Pull Request: #4463
@christophstrobl christophstrobl added this to the 4.2 M3 (2023.1.0) milestone Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants