Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Serverless Web Applications with React and Firebase

You're reading from   Serverless Web Applications with React and Firebase Develop real-time applications for web and mobile platforms

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788477413
Length 284 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Harmeet Singh Harmeet Singh
Author Profile Icon Harmeet Singh
Harmeet Singh
Mayur Tanna Mayur Tanna
Author Profile Icon Mayur Tanna
Mayur Tanna
Arrow right icon
View More author details
Toc

Rule definition and structure


Firebase rules provide predefined variables that can be used inside a rule definition:

Name

Definition / Usage

auth

It represents information of the authenticated user. It will be null for an unauthenticated user. It is an object that contains uid, token, and provider fields and corresponding values.

$ variables

It represents wildcard path to refer to the dynamically generated keys and represent IDs.

root

It represents data snapshot at the root path in the Firebase database before applying the given database operation.

data

It represents the Data Snapshot before applying the given database operation. For example, in case of the update or write, the root represents the original data snapshot without the changes in the update or write.

newData

It represents the Data Snapshot before applying the given database operation. However, it includes both the existing data as well as the new data, which includes data manipulated by the given data operation.

now

It represents current...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image