how to make relation for no sql database?
You can say it for firebase database, where database is in json format.
how to make relation for no sql database?
You can say it for firebase database, where database is in json format.
A NO SQL database means that database has no relations. Either go with SQL database and convert JSON format or face the truth that in NOSQL there are no relations.
Before anything, I will give you an example of how to try to do this, but I want to tell you that I wouldn't actually do this again. Firebase is no good replace for MySQL.
Making relations for a noSQL database is not possible, but you could always make them "manually" and decide how to work with it.
What I meant with "manually" is that you can duplicate data for that, but that's not a very good option. For example, I made long ago an Android app to manage neightbour communities, and because of the time I had to do it I decided to make it with Firebase.
And I will never do it again, to be honest. I didn't want to lose time on an API, but I lost it anyway trying to structure everything nicely and with all the changes I had to make every 2 days so everything wouldn't fail.
Here you have an example. The database has 2 nodes, the communities and the users.
The users have these fields:
And, meanwhile, the communities have an incidences list, and those store the email of its author as any other field (image not relatable, they are random ones).
So, TLDR: No, you can't make relations. The only way to do what you want is with duplicated data, like the email of its author on the incidence.
PS: I made a chat app with Firebase in my company, I would share the DB with you so you can see the structure, but it's confidential, you know.