I\'m looking to get data where two fields equal what I\'m passing in.
Here\'s an example of my code:
this.refApp
.orderByChild(\'u
It's not supported.
Depending on the kind of query you need to run on an entity, you will either have to store you jobs by user like @david-east suggested or add a property combining the two properties:
{
jobId: 'J123',
userId: 'provider:123',
jobIdUserIdIndex: 'J123/provider:12345',
[...]
}
But usually, there are no way to allow all the queries you need. You either have to filter objects on the client side, or duplicate the data to created different view of the data; you will have the job data saved at /jobs/$jobId, /users/$userId/jobs/$jobId and maybe /pendingJobs/$jobId.
I find it's easier to use the orderBy* method only for ordering entities and to duplicate the data to select subsets of them.
I wish Firebase would support indexes combining multiple properties, but for now you need to build those yourself. However having different views allows to apply different security rules to them: e.g. Only one user should have access to /users/$userId/jobs/, only the admin should have access to /jobs/$jobId.