snchmt
snchmt
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
Also it means that I should duplice all my fields into a schema and a type
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
I know that I'm trying to use a document database for relational purposes but most of my data is in document format except this part
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
If I use objects it means that I should normalize on the front-end or the back-end, and if I want to modify a child element I need to search in the elements or modify the whole object
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
For now I used a raw query which disables prisma verifications
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
How can I fix it ?
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
I just used a childrenId like in the model above, the on on delete cascade is not authorized on mongodb, that's the issue here
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
yes it's something like that
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
That's why I created a recursive function to get all the children ids
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
A tag can have children tags, and these tags can also have children tags
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
it means that a tag can have children, and these children may also have children, etc
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
My tags are recursive, do you mean that I should create a query per level ? I remember that using deleteMany already creates a transaction, what's new with this way ?
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
I let this thread open, I used the run raw query but I would like something cleaner if someone has
23 replies
PPrisma
Created by snchmt on 4/15/2024 in #help-and-questions
How to cascade delete properly in a self-relation with mongodb ?
23 replies
PPrisma
Created by Bean on 4/16/2024 in #help-and-questions
union type findMany
I think the issue here is that you are using a generic method that uses the generic type of an interface, but the generic types of the interfaces are not compatible, so the only way possible here is to cast somewhere or use a ts-ignore
14 replies
PPrisma
Created by Bean on 4/16/2024 in #help-and-questions
union type findMany
Sorry, I was waiting for your modifications I forgot to check again
14 replies
PPrisma
Created by Bean on 4/16/2024 in #help-and-questions
union type findMany
Could you create a TS playground with the code ?
14 replies