Nope. The Firebase Web / JavaScript API always returns a complete tree under the nodes you requested.
The most common workaround for this is that people set up a secondary branch in the tree, where they simply store the keys.
Notes 1: { "body": "hello", "title": "yessir" } 2: { "body": "again", "title": "title2" } 3: { "body": "there", "title": "another" } Notes_index 1: true 2: true 3: true
This is commonly called an index. You are on('child_added' on Notes_index , and then (if necessary) get the contents of each note using once('value' .
Indexes are also often used to access nodes using an alternate key. For example, the header index for the above:
Title_index "another": 3 "title2": 2 "yessir": 1
This last structure may not be needed in the near future, as Firebase expands its query API to allow ordering / filtering in any field. But for your use case, the index is still useful.
source share