From 05eacadeff32dd32d7cb0d2e2c67e969ba307ddb Mon Sep 17 00:00:00 2001 From: Patrick McDonald Date: Sat, 27 May 2017 10:37:54 -0400 Subject: [PATCH] docs: recommend orderByChild in favor of orderByPriority --- docs/4-querying-lists.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/4-querying-lists.md b/docs/4-querying-lists.md index 46119ccdf..280bb5225 100644 --- a/docs/4-querying-lists.md +++ b/docs/4-querying-lists.md @@ -19,19 +19,21 @@ const queryObservable = db.list('/items', { **Query Options:** -| method | purpose | -| ---------|--------------------| +| method | purpose | +| ---------|--------------------| | `orderByChild` | Specify a child to order by. | | `orderByKey` | Boolean to order by Firebase Database keys. | -| `orderByPriority` | Boolean to order by Firebase Database priority. | | `orderByValue` | Specify a value to order by. | -| `equalTo` 1 | Limit list to items that contain certain value. | +| ~~`orderByPriority`~~1 | Boolean to order by Firebase Database priority.| +| `equalTo`2 | Limit list to items that contain certain value. | | `limitToFirst` | Sets the maximum number of items to return from the beginning of the ordered list of results. | | `limitToLast` | Sets the maximum number of items to return from the end of the ordered list of results. | -| `startAt` 1 | Return items greater than or equal to the specified key or value, depending on the order-by method chosen. | -| `endAt` 1 | Return items less than or equal to the specified key or value, depending on the order-by method chosen. | +| `startAt`2 | Return items greater than or equal to the specified key or value, depending on the order-by method chosen. | +| `endAt`2 | Return items less than or equal to the specified key or value, depending on the order-by method chosen. | -1 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' }`. +1 [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`. + +2 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' }`. ## Invalid query combinations