MongoDB: forced referential actions to prevent looping (target 3.7)
See original GitHub issueDev work is PR #2415 Per Flavian: Any MongoDB datamodel with self relations or cycles between 3 models will be forced to set some specific referential actions to prevent the referential action emulations from looping infinitely (eg: Cascade cannot work).
The rules and examples have already been all written for SQL Server here. And here
These limitations exist as soon as you enable the referentialIntegrity = "prisma" mode. Since it’s enabled for MongoDB by default, it’s the primary target for this change.
Proposal is that we create a different page based on the SQL Server one for the prisma referentialIntegrity mode and there explain how that affects MongoDB.
Note: The Multiple cascade paths between two models chapter do not apply though.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Special rules for referential actions in SQL Server and MongoDB
With MongoDB, using referential actions in Prisma requires that for any data model ... to prevent the referential action emulations from looping infinitely....
Read more >Transactions — MongoDB Manual
Multi-document transactions provide an “all-or-nothing” proposition. When a transaction commits, all data changes made in the transaction are saved. If any ...
Read more >mongoose/CHANGELOG.md at master - GitHub
MongoDB object modeling designed to work in an asynchronous environment. ... fix(types): avoid baffling circular reference when using PopulatedDoc with a ...
Read more >Mongoose v6.8.1: API docs
Set to true to clone() all schemas before compiling into a model. debug : If true , prints the operations mongoose sends to...
Read more >lookup info from MongoDB - Ansible Documentation
More info at https://docs.mongodb.org/manual/reference/connection-string/. database. required. Name of the database which the query will be made.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think this has been merged and will be part of 3.7 indeed.
Let’s get #2581 over the finish line then to make this easier.
Thanks @janpio ! Good news, then @keerlu will merge #2581 Monday morning, and I will start a new PR for this work. (Yep, we could have made a PR on top of her PR, but I like the simplicity of first merging hers, then I do a separate one.)