Best Software for 2025 is now live!
divyesh k.
DK
Team Lead at Infibeam

How can i make relation between two tables?

I want to give relation key between two tables like foreign key but i couldn't. Please help me with that.
3 comments
Looks like you’re not logged in.
Users need to be logged in to answer questions
Log In
Omar C.
OC
Software developer
0
Here there is no problem with data duplication, you can use a common id in both tables and query each one with the common information or simply put the information you require from the other table in a single table.
Looks like you’re not logged in.
Users need to be logged in to write comments
Log In
Reply
Hafiz Muhammad Ali S.
HS
React JS || React Native || Node JS || Blockchain || MongoDB || MSSQL
0
You can simple add relations by adding reference to that documents example code in JavaScript: const sendContactUs = async (userData, uid) => { await firestore().collection("ContactUs").add({ Email: userData.Email, phoneNumber: userData.phoneNumber, message: userData.message, uid: uid, user: firestore().collection("Users").doc(uid), status:"Pending" }) }
Looks like you’re not logged in.
Users need to be logged in to write comments
Log In
Reply
Saurabh G.
SG
Senior iOS Engineer at NovaSignal
0
Firebase in not relational database. Its a NoSQL DB like MongoDB. So theoretically you can't make relation between tables. What you can do is keep id reference of one table (or better say json file/data) into other and query accordingly or filter it locally on client side with high level functions like reduce and/or filter.
Looks like you’re not logged in.
Users need to be logged in to write comments
Log In
Reply