-
Notifications
You must be signed in to change notification settings - Fork 987
Add startAfter() and endBefore() to database types #4427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@firebase/database-types": minor | ||
| "@firebase/database": patch | ||
| "firebase": patch | ||
| --- | ||
|
|
||
| Add `startAfter()` and `endBefore()` to the Realtime Database TypeScript definitions. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5942,8 +5942,8 @@ declare namespace firebase.database { | |
| /** | ||
| * Creates a `Query` with the specified ending point. | ||
| * | ||
| * Using `startAt()`, `endAt()`, and `equalTo()` allows you to choose arbitrary | ||
| * starting and ending points for your queries. | ||
| * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` | ||
| * allows you to choose arbitrary starting and ending points for your queries. | ||
| * | ||
| * The ending point is inclusive, so children with exactly the specified value | ||
| * will be included in the query. The optional key argument can be used to | ||
|
|
@@ -5959,6 +5959,7 @@ declare namespace firebase.database { | |
| * @example | ||
| * ```javascript | ||
| * // Find all dinosaurs whose names come before Pterodactyl lexicographically. | ||
| * // Include Pterodactyl in the result. | ||
| * var ref = firebase.database().ref("dinosaurs"); | ||
| * ref.orderByKey().endAt("pterodactyl").on("child_added", function(snapshot) { | ||
| * console.log(snapshot.key); | ||
|
|
@@ -5977,11 +5978,43 @@ declare namespace firebase.database { | |
| value: number | string | boolean | null, | ||
| key?: string | ||
| ): firebase.database.Query; | ||
| /** | ||
| * Creates a `Query` with the specified ending point (exclusive). | ||
| * | ||
| * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` | ||
| * allows you to choose arbitrary starting and ending points for your queries. | ||
| * | ||
| * The ending point is exclusive. If only a value is provided, children | ||
| * with a value less than the specified value will be included in the query. | ||
egilmorez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * If a key is specified, then children must have a value lesss than or equal | ||
| * to the specified value and a a key name less than the specified key. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed
egilmorez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @example | ||
| * ```javascript | ||
| * // Find all dinosaurs whose names come before Pterodactyl lexicographically. | ||
| * // Do not include Pterodactyl in the result. | ||
| * var ref = firebase.database().ref("dinosaurs"); | ||
| * ref.orderByKey().endBefore("pterodactyl").on("child_added", function(snapshot) { | ||
| * console.log(snapshot.key); | ||
| * }); | ||
| * | ||
| * @param value The value to end before. The argument | ||
| * type depends on which `orderBy*()` function was used in this query. | ||
| * Specify a value that matches the `orderBy*()` type. When used in | ||
| * combination with `orderByKey()`, the value must be a string. | ||
| * @param key The child key to end before, among the children with the | ||
| * previously specified priority. This argument is only allowed if ordering by | ||
| * child, value, or priority. | ||
| */ | ||
| endBefore( | ||
| value: number | string | boolean | null, | ||
| key?: string | ||
| ): firebase.database.Query; | ||
| /** | ||
| * Creates a `Query` that includes children that match the specified value. | ||
| * | ||
| * Using `startAt()`, `endAt()`, and `equalTo()` allows us to choose arbitrary | ||
| * starting and ending points for our queries. | ||
| * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` | ||
| * allows you to choose arbitrary starting and ending points for your queries. | ||
| * | ||
| * The optional key argument can be used to further limit the range of the | ||
| * query. If it is specified, then children that have exactly the specified | ||
|
|
@@ -6426,8 +6459,8 @@ declare namespace firebase.database { | |
| /** | ||
| * Creates a `Query` with the specified starting point. | ||
| * | ||
| * Using `startAt()`, `endAt()`, and `equalTo()` allows you to choose arbitrary | ||
| * starting and ending points for your queries. | ||
| * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` | ||
| * allows you to choose arbitrary starting and ending points for your queries. | ||
| * | ||
| * The starting point is inclusive, so children with exactly the specified value | ||
| * will be included in the query. The optional key argument can be used to | ||
|
|
@@ -6460,6 +6493,37 @@ declare namespace firebase.database { | |
| value: number | string | boolean | null, | ||
| key?: string | ||
| ): firebase.database.Query; | ||
| /** | ||
| * Creates a `Query` with the specified starting point (exclusive). | ||
| * | ||
| * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` | ||
| * allows you to choose arbitrary starting and ending points for your queries. | ||
| * | ||
| * The starting point is exclusive. If only a value is provided, children | ||
| * with a value greater than the specified value will be included in the query. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above; "are included"
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| * If a key is specified, then children must have a value greater than or equal | ||
| * to the specified value and a a key name greater than the specified key. | ||
egilmorez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @example | ||
| * ```javascript | ||
| * // Find all dinosaurs that are more than three meters tall. | ||
| * var ref = firebase.database().ref("dinosaurs"); | ||
| * ref.orderByChild("height").startAfter(3).on("child_added", function(snapshot) { | ||
| * console.log(snapshot.key) | ||
| * }); | ||
| * ``` | ||
| * | ||
| * @param value The value to start after. The argument | ||
| * type depends on which `orderBy*()` function was used in this query. | ||
| * Specify a value that matches the `orderBy*()` type. When used in | ||
| * combination with `orderByKey()`, the value must be a string. | ||
| * @param key The child key to start after. This argument is only allowed | ||
| * if ordering by child, value, or priority. | ||
| */ | ||
| startAfter( | ||
| value: number | string | boolean | null, | ||
| key?: string | ||
| ): firebase.database.Query; | ||
| /** | ||
| * Returns a JSON-serializable representation of this object. | ||
| * | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.