question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MongoDB: forced referential actions to prevent looping (target 3.7)

See original GitHub issue

Dev 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:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
janpiocommented, Dec 17, 2021

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.

1reaction
tanberrycommented, Dec 17, 2021

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.)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found