Firestore Clients And Invoices, Amended Requirement
This question is a follow up question to the one posted here: Firestore: Clients and invoices, how to model it I am trying to understand the thought process behind modelling evolvi
Solution 1:
According to the requirements that we see in this post, which I understand are mandatory in your project:
Show invoices that a client has
and
Update all invoices in the system to false
The most appropriate schema that can I recommend you, is the one in which you should add a new property called userId
, beneath each invoice
object.
So please consider using this tehnique, which is actually called a the reverse lookup. It will help you query your database more easily and will also help you solve both problems.
Post a Comment for "Firestore Clients And Invoices, Amended Requirement"