voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
31 lines (18 loc) • 1.12 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[](./index.md) > [@firebase/database](./database.md) > [setWithPriority](./database.setwithpriority.md)
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](https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data) ).
<b>Signature:</b>
```typescript
export declare function setWithPriority(ref: Reference, value: unknown, priority: string | number | null): Promise<void>;
```
| Parameter | Type | Description |
| --- | --- | --- |
| ref | [Reference](./database.reference.md) | 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). |
<b>Returns:</b>
Promise<void>
Resolves when write to server is complete.