Skip to Content
Serverless Web Applications with React and Firebase
book

Serverless Web Applications with React and Firebase

by Mayur Tanna, Harmeet Singh
April 2018
Intermediate to advanced content levelIntermediate to advanced
284 pages
6h 43m
English
Packt Publishing
Content preview from Serverless Web Applications with React and Firebase

Data indexing

Firebase allows you to write queries using child keys. To improve your query performance, you can define an index on those keys using the .indexOn rule. We assume that you already knew how the index works as almost all database systems support index.

Let's take an example to understand this better. Let's say that in our HelpDesk system, we often order tickets by department key, and we are using orderbyChild():

{  "rules": {     "helpdesk": {           "tickets": {               ".indexOn": ["department"]            }      }  }}

Similarly, if we are using orderByValue(), we can have the following rule:

".indexOn": ".value"
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Web Applications with Firebase

Building Web Applications with Firebase

Gareth Brown
React Native in Action

React Native in Action

nader dabit, Nickie Buckner

Publisher Resources

ISBN: 9781788477413Supplemental Content