Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on Jun 2, 2023

Cascading delete for DBRefs

Since transactions have been added in 2018, which work across collections (https://www.mongodb.com/docs/manual/core/transactions/) and across shards (https://www.mongodb.com/docs/manual/core/transactions-sharded-clusters/), shouldn't cascading deletes be possible now? I only worked with sql transactions in the past, but my intuition would be that it should be fairly easy to do this in a client: 1. start a transaction 2. fetch document 3. look for dbref fields 4. fetch those docs 5. continue at 2 until all docs have been found, stopping at branches when a doc has already been fetched 6. go back in reverse and delete all of them 7. commit transaction If this is possible to do in a client, it should be possible to do on the server as well, shouldn't it? Old and possibly outdated feature request: https://jira.mongodb.org/browse/SERVER-1298?signupSource=Account
  • Attach files