Representation of data
for use in rule expressions.
https://firebase.google.com/docs/reference/security/database#data
Representation of newData
for use in rule expressions.
https://firebase.google.com/docs/reference/security/database#newdata
Representation of root
for use in rule expressions.
https://firebase.google.com/docs/reference/security/database#root
Representation of ".value"
to be used in indexOn
rules.
Calculates b
added to a
and so on.
add(a, b, c, ...)
is equivalent to a + b + c ...
.
Requires all of its expressions to be true
.
allOf(a, b, c)
is equivalent to a && b && c
.
Returns a strictly true
expression.
read(allowAll)
is the same as { ".read": false }
Checks if a
is between lower
and upper
, exclusive.
between(a, b, c)
is equivalent to a > b && a < c
.
Calculates b
concatenated to a
and so on.
concat(a, b, ...)
is equivalent to a + b + c + ...
.
Creates a representation of a Firebase RuleDataSnapshots for use in rules.
Note that val()
is not type-specific so it's not available. Use isString
,
isNumber
, etc. to apply rules to val()
.
data.isString(val => lessThan(val.length, 100))
is the same as
data.isString() && data.val().length < 100
.
https://firebase.google.com/docs/reference/security/database#ruledatasnapshot_methods
A representation of a Firebase Rule primitive such as a number or boolean.
A representation of a Firebase Rule String.
https://firebase.google.com/docs/reference/security/database#string_properties
Returns a strictly false
expression.
read(denyAll)
is the same as { ".read": false }
Calculates b
divided by a
and so on.
divide(a, b, c, ...)
is equivalent to a / b / c ...
.
Does an equality check between a
and b
.
equal(a, b)
is equivalent to a === b
Checks if a
is greater than b
.
greaterThan(a, b)
is equivalent to a > b
.
Creates an .indexOn
rule with the given string fields
.
indexOn(value, 'custom')
is the same as { ".indexOn": [".value", "custom"] }"
https://firebase.google.com/docs/reference/security/database#indexon
Checks if a
is less than b
.
lessThan(a, b)
is equivalent to a < b
.
Calculates a
modulus b
and so on.
modulus(a, b, c, ...)
is equivalent to a % b % c ...
.
Calculates b
multiplied by a
and so on.
multiply(a, b, c, ...)
is equivalent to a * b * c ...
.
Negates a
.
negate(a)
is equivalent to -a
.
Negates an expression.
not(a)
is equivalent to !a
.
Representation of now
for use in rule expressions.
https://firebase.google.com/docs/reference/security/database#now
Requires at least one of its expressions to be true
.
oneOf(a, b, c)
is equivalent to a || b || c
.
Defines a parameter which you can use for inner rules.
node(param('$id', $id => node(validate(equal($id, auth.uid))) ))
is the same as
{ "$id": { ".validate": "$id === auth.uid" } }
https://firebase.google.com/docs/reference/security/database#location
Defines multiple properties with their own rules.
node(props({ one: node(), two: node() }))
is the same as
{ "one": { }, "two": { } }
Creates a .read
rule with the given expression
.
read(allowAll)
is the same as { ".read": true }
https://firebase.google.com/docs/reference/security/database#read
Calculates b
subtracted from a
and so on.
subtract(a, b, c, ...)
is equivalent to a - b - c ...
.
Converts a RuleExpression
to its JSON string form.
toJSONString(equal(a, b))
renders "(a === b)"
Creates a .validate
rule with the given expression
.
validate(allowAll)
is the same as { ".validate": true }
https://firebase.google.com/docs/reference/security/database#validate
Creates a .write
rule with the given expression
.
write(allowAll)
is the same as { ".write": true }
https://firebase.google.com/docs/reference/security/database#write
Generated using TypeDoc
Representation of
auth
for use in rule expressions.https://firebase.google.com/docs/reference/security/database#auth