Firebase - Relationship between documents

Asked

Viewed 1,031 times

2

I know the firebase is Nosql/Norel, but I have this doubt and it is very relevant given to the project I am developing.

In the traditional Mysql model, when we have a table of categorias, for example and a table posts and there is a relationship between them, a category that has posts attached to it, usually cannot be deleted.

How this is done in Firebase, since any document can be deleted. And in case the category is deleted, as is the post "orphan"?

I would like to better understand how this works, because I’m used to the relational model and I’m having difficulties at this point with Nosql banks.

NOTE: I am using Firestore, which is currently a BETA version.

  • Realtime database or cloud firestore?

  • I’m using the Firestore!

  • Each case is a case, it depends a lot on what you want to do with the bank, take a look at documentation to get an idea

  • Sorry @Guilhermecostamilam, I found your comment a little generic, but that’s okay. I’m seeing here more details about this, despite the lack of time, I’ll have to dive deeper into the documentation.

  • In the Firestore, you can do this through safety rules. If you post your "posts" and "categories" collection, I can help you write the rules.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.