Gets the currently applied security rules as a string. The return value consists of the rules source including comments.
A promise fulfilled with the rules as a raw string.
Gets the currently applied security rules as a parsed JSON object. Any comments in the original source are stripped away.
A promise fulfilled with the parsed rules object.
Disconnects from the server (all Database operations will be completed offline).
The client automatically maintains a persistent connection to the Database server, which will remain active indefinitely and reconnect when disconnected. However, the
goOnline()methods may be used to control the client connection in cases where a persistent connection is undesirable.
While offline, the client will no longer receive data updates from the Database. However, all Database operations performed locally will continue to immediately fire events, allowing your application to continue behaving normally. Additionally, each operation performed locally will automatically be queued and retried upon reconnection to the Database server.
To reconnect to the Database and begin receiving remote events, see
Reconnects to the server and synchronizes the offline Database state with the server state.
This method should be used after disabling the active connection with
goOffline(). Once reconnected, the client will transmit the proper data and fire the appropriate events so that your client "catches up" automatically.
Referencerepresenting the location in the Database corresponding to the provided path. Also can be invoked with an existing
Referenceas the argument. In that case returns a new
Referencepointing to the same location. If no path argument is provided, returns a
Referencethat represents the root of the Database.
Optional path: string | Reference
Optional path representing the location the returned
Referencewill point. Alternatively, a
Referenceobject to copy. If not provided, the returned
Referencewill point to the root of the Database.
If a path is provided, a
Referencepointing to the provided path. Otherwise, a
Referencepointing to the root of the Database.
Referencerepresenting the location in the Database corresponding to the provided Firebase URL.
An exception is thrown if the URL is not a valid Firebase Database URL or it has a different domain than the current
Note that all query parameters (
limitToLast, etc.) are ignored and are not applied to the returned
The Firebase URL at which the returned
Referencepointing to the provided Firebase URL.
Sets the specified rules on the Firebase Realtime Database instance. If the rules source is specified as a string or a Buffer, it may include comments.
source: string | Buffer | object
Source of the rules to apply. Must not be
Resolves when the rules are set on the Realtime Database.