Matt Matt - 1 year ago 269
reST (reStructuredText) Question

Get multiple child nodes in Firebase with REST API

I have following database hierarchy in my Firebase application.

enter image description here

I know about query parameters in REST API, but how can I get group1 and group2 by single http request?

Answer Source

The only way to get multiple nodes in a REST request is by having a query that matches the nodes you are looking for. Since Firebase Database queries don't have a WHERE key IN (a,b,c) type operation, the query will have to match some property value/range.

In your specific example you could order by key and limit to the first 2 results:


But in general if you want to retrieve a set of N children through the Firebase API, it will require N calls.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download