Home > @firebase/database > setWithPriority
setWithPriority() function
Writes data the Database location. Like set()
but also specifies the priority for that data.
Applications need not use priority but can order collections by ordinary properties (see Sorting and filtering data ).
Signature:
export declare function setWithPriority(ref: Reference, value: unknown, priority: string | number | null): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
ref | Reference | The location to write to. |
value | unknown | The value to be written (string, number, boolean, object, array, or null). |
priority | string | number | null | The priority to be written (string, number, or null). |
Returns:
Promise<void>
Resolves when write to server is complete.