Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit depth of data returned

Is it possible to limit the depth of data returned from Firebase database?

For example, if I want to get some data from a parent object without waiting for all of its children & sub-children, can I specify that I only want x levels of objects?

like image 283
SarahR Avatar asked Mar 26 '13 05:03

SarahR


2 Answers

Firebase does not yet have this capability.

We do intend to add it, but don't have a timetable yet.

like image 171
Andrew Lee Avatar answered Oct 26 '22 22:10

Andrew Lee


There appears to be a shallow option...

{
  "message": {
    "user": {
      "name": "Chris"
    },
    "body": "Hello!"
  }
}

// A request to /message.json?shallow=true
// would return the following:
{
  "user": true,
  "body": true
}

// A request to /message/body.json?shallow=true
// would simply return:
"Hello!"

From: https://firebase.google.com/docs/database/rest/retrieve-data

like image 39
Billy Moon Avatar answered Oct 26 '22 22:10

Billy Moon