polymerfire
polymerfire copied to clipboard
Create Denormalized Version of firebase-query
The firebase-query element works well for querying a standard list of subnodes, but given that so much of what we have to do relies on querying, updating or deleting multiple nodes in the database it would be useful if that functionality were bundled into a "distributed-query" element.
For example, let's say that you have an employee node that lists all of the employees. And you have a team-employee node that lists the teams and all of the employees that belong to those teams. To query for all employees on a given team, you have to go to the relevant team-employee node and then add a child-added listener, and go fetch the appropriate employee node.
Since this is such a common usage pattern, it would be nice if this were wrapped up into an element.
<firebase-dist-query relational-node="team-employee" dep-node="employee" path="/team-employee/[[someTeamId]]" data="{{teamMembers}}"></firebase-dist-query>
Hey, Agreed that reconciling nodes while querying could be smoother.
For the time being, I use smth along the lines (firebase-nest available on webcomponent.org) :
<firebase-nest path="/countryList" data="{{data}}">
<template is="dom-repeat" items="{{data}}">
<firebase-value key="code" data={{item}}" path="/countryNames/[[item.$key]]/country-code"></firebase-value>
</template>
</firebase-nest>
@christophe-g That's cool! Have you seen anything that makes distributed updates and deletes easier?