В настоящее время я работаю над приложением с базой данных Firebase в реальном времени.В базе данных они являются объектами Customer и Work.Структура моих нынешних данных иллюстрируется ниже.Я хочу фильтровать работы по клиенту.Какой запрос я должен выполнить в базе данных?
+--customers
|
+-- customerKey1
| |
| +-- <customerData1> ..
|
+-- customerKey2
|
+-- <customerData2>..
+--works
|
+-- workKey1
| |
| +-- customerKey : customerKey2 // this work belongs to customer2
| |
| +-- <the rest of work1 data
|
+-- workKey2
| |
| +-- customerKey : customerKey2 // this work belongs to customer2
| |
| +-- <the rest of work2 data
|
+-- workKey3
| |
| +-- customerKey : customerKey1 // this work belongs to customer1
| |
| +-- <the rest of work3 data
|
+-- workKey4
|
+-- customerKey : customerKey1 // this work belongs to customer1
|
+-- <the rest of work4 data