我有一个带有分支的firebase数据库,例如:
/Customers/{CustomerID}/{CustomerName}
                        {CustomerAddress}
/Contacts/{CustomerID}/{contactID}/{ContactName}
                                   {contactPhone}
                                   {contactEmail}
/sampleout/{customerId}/{sampleoutID}/.....
other Data including the customer name, contact etc etc that is kept above.
Run Code Online (Sandbox Code Playgroud)
我正在寻找引用客户和联系信息的最佳方式:1)在FB树中存储两次.2)进行2次或更多次阅读.
因此,我希望能够读取/ sampleOut树,并且当它读取说示sampleID 1并且它指向给定客户时,它也会拾取该客户对象,而不必在我的代码中创建"读取"调用.