[SERVER-30976] Conditional Update/Insert Operation, Batched to a Find/Find-and-Modify Op Created: 06/Sep/17  Updated: 15/Nov/21  Resolved: 23/Nov/17

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Victor Stewart Assignee: Asya Kamsky
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-11508 Multi-document transactions across sh... Closed
Related
related to SERVER-6566 Support conditional updates: $updates Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Very often I find myself having to run a find (or find and modify) operation on one collection, check the result, and then conditionally push an update or insert to a different collection. Constantly requiring two round trips to the database.

It would be incredible if you could batch these together. Execute a find or find-and-modify operation, then depending on a field or fields gathered, execute a secondary operation on a different (or the same) collection. Maybe even feed the find result into the secondary operation (but that would be asking a lot, haha).



 Comments   
Comment by Asya Kamsky [ 23/Nov/17 ]

victorstewart

It sounds like what you need to be able to do what you described are multi-document/multi-statement transactions.

I've resolved this ticket as a duplicate of SERVER-11508 which tracks adding support for transactions to MongoDB.

Comment by Mark Agarunov [ 15/Sep/17 ]

Hello victorstewart,

On further examination, this request appears to be similar to, but not a duplicate of SERVER-6566. I've set the fixVersion to "Needs Triage" for this new feature to be scheduled against our currently planned work. Updates will be posted on this ticket as they happen.

Thanks,
Mark

Comment by Asya Kamsky [ 09/Sep/17 ]

I don't think this is related to SERVER-6566 since that's about multiple updates to same document happening conditionally, and this is about updating documents with values from another.

Comment by Mark Agarunov [ 07/Sep/17 ]

Hello victorstewart,

Thank you for the report. Looking over the behavior you've described, this appears to be a similar request to SERVER-6566, which would allow conditional updates. I've closed this ticket as a duplicate, please follow SERVER-6566 for updates on this issue.

Thanks,
Mark

Generated at Thu Feb 08 04:25:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.