简体   繁体   中英

How to map a particular field in firestore database

For example, if I have the fields like empId,empName in Employees collection and empName,city in another collection called EmployeeCities If I change the empName in the Employees collection, the change should reflect in EmployeeCities. I know I can update them manually but, I am asking if we can map certain fields as in SQL primary key and foreign key.

Firestore is a NoSQL database, (not a relational database), which means it doesn't enforce relationships between documents and collections. You cannot designate fields as primary or foreign key. Any relationship between documents and collection are those that you impose for yourself in your source code. The database will not enforce them for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM