Skip to content

Commit 3b6866a

Browse files
authored
Merge pull request angular#1006 from patrickmcd/patch-1
docs: recommend orderByChild in favor of orderByPriority
2 parents f673bd5 + 05eacad commit 3b6866a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/4-querying-lists.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ const queryObservable = db.list('/items', {
1919

2020
**Query Options:**
2121

22-
| method | purpose |
23-
| ---------|--------------------|
22+
| method | purpose |
23+
| ---------|--------------------|
2424
| `orderByChild` | Specify a child to order by. |
2525
| `orderByKey` | Boolean to order by Firebase Database keys. |
26-
| `orderByPriority` | Boolean to order by Firebase Database priority. |
2726
| `orderByValue` | Specify a value to order by. |
28-
| `equalTo` <sup>1</sup> | Limit list to items that contain certain value. |
27+
| ~~`orderByPriority`~~<sup>1</sup> | Boolean to order by Firebase Database priority.|
28+
| `equalTo`<sup>2</sup> | Limit list to items that contain certain value. |
2929
| `limitToFirst` | Sets the maximum number of items to return from the beginning of the ordered list of results. |
3030
| `limitToLast` | Sets the maximum number of items to return from the end of the ordered list of results. |
31-
| `startAt` <sup>1</sup> | Return items greater than or equal to the specified key or value, depending on the order-by method chosen. |
32-
| `endAt` <sup>1</sup> | Return items less than or equal to the specified key or value, depending on the order-by method chosen. |
31+
| `startAt`<sup>2</sup> | Return items greater than or equal to the specified key or value, depending on the order-by method chosen. |
32+
| `endAt`<sup>2</sup> | Return items less than or equal to the specified key or value, depending on the order-by method chosen. |
3333

34-
<sup>1</sup> The Firebase SDK supports an optional `key` parameter for [`startAt`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#startAt), [`endAt`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#endAt), and [`equalTo`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#equalTo) when ordering by child, value, or priority. You can specify the `key` parameter using an object literal that contains the `value` and the `key`. For example: `startAt: { value: 'some-value', key: 'some-key' }`.
34+
<sup>1</sup> [This is the old way of doing things and is no longer recommended for use](https://youtu.be/3WTQZV5-roY?t=3m). Anything you can achieve with `orderByPriority` you should be doing with `orderByChild`.
35+
36+
<sup>2</sup> The Firebase SDK supports an optional `key` parameter for [`startAt`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#startAt), [`endAt`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#endAt), and [`equalTo`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#equalTo) when ordering by child, value, or priority. You can specify the `key` parameter using an object literal that contains the `value` and the `key`. For example: `startAt: { value: 'some-value', key: 'some-key' }`.
3537

3638
## Invalid query combinations
3739

0 commit comments

Comments
 (0)