34 Operators and Functions
This chapter provides a detailed reference to the operators and built-in functions supported in Oracle Backend for Firebase security rule expressions. These tools allow developers to write expressive, conditional logic that governs access to backend resources.
Parent topic: Security Rules
34.1 Operators
Operators are used to perform comparisons, logical evaluations, and arithmetic operations within rule conditions.
Logical Operators
| Operator | Description | Example |
|---|---|---|
|
|
Logical NOT |
|
|
|
Logical AND |
|
|
|
Logical OR This operator returns |
|
Comparison Operators
| Operator | Description | Example |
|---|---|---|
|
|
Equal |
|
|
|
Not equal |
|
|
|
Greater than |
|
|
|
Greater than or equal |
|
|
|
Less than |
|
|
|
Less than or equal |
|
|
|
Value |
|
|
|
Type check (For example, |
|
Arithmetic Operators
| Operator | Description | Example |
|---|---|---|
|
|
Addition |
|
|
|
Subtraction |
|
|
|
Multiplication |
|
|
|
Division |
|
Additional Operators
| Operator | Description | Example |
|---|---|---|
|
|
Indexing operator This operator accesses the element at index |
|
|
|
Field access operator This operator accesses the field |
|
Parent topic: Operators and Functions
34.2 Built-in Functions
Oracle Backend for Firebase security rules support a rich set of functions across different data types.
String Functions
| Function | Description | Example |
|---|---|---|
|
|
Converts to lowercase |
|
|
|
Converts to uppercase |
|
|
|
Regex match |
|
|
|
Replace substring |
|
|
|
Split string into list |
|
|
|
Remove white (blank) space |
|
|
|
String length |
|
List Functions
| Function | Description | Example |
|---|---|---|
|
|
Merge lists |
|
|
|
All elements exist |
|
|
|
Any element exists |
|
|
|
Only specified elements exist |
|
|
|
List length |
|
Timestamp Functions
| Function | Description | Example |
|---|---|---|
|
|
Extract year |
|
|
|
Extract month |
|
|
|
Extract day |
|
|
|
Day of week |
|
|
|
Day of year |
|
|
|
Extract hour |
|
|
|
Extract minutes |
|
|
|
Extract seconds |
|
|
|
Extract nanoseconds |
|
|
|
Convert to milliseconds |
|
Math Functions
| Function | Description | Example |
|---|---|---|
|
|
Absolute value |
|
|
|
Round up |
|
|
|
Round down |
|
|
|
Power |
|
|
|
Round to nearest |
|
|
|
Square root |
|
Indexing and Slicing
| Operation | Example |
|---|---|
|
Access element |
|
|
Slice list |
|
Parent topic: Operators and Functions