From 92fc46b21f6a31ea50f7d03ccfb280a0965a9e5b Mon Sep 17 00:00:00 2001 From: ehesp Date: Tue, 27 Aug 2019 16:03:01 +0100 Subject: [PATCH] Add missing where type --- packages/firestore/lib/index.d.ts | 32 +++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/firestore/lib/index.d.ts b/packages/firestore/lib/index.d.ts index ae1bd5ab..d987a885 100644 --- a/packages/firestore/lib/index.d.ts +++ b/packages/firestore/lib/index.d.ts @@ -1060,7 +1060,8 @@ export namespace Firestore { * const querySnapshot = await firebase.firestore() * .collection('users') * .orderBy('age') - * .startAfter(user); + * .startAfter(user) + * .get(); * ``` * * > Cursor snapshot queries have limitations. Please see [Query limitations](/) for more information. @@ -1080,7 +1081,8 @@ export namespace Firestore { * const querySnapshot = await firebase.firestore() * .collection('users') * .orderBy('age') - * .startAfter(30); + * .startAfter(30) + * .get(); * ``` * * @param fieldValues The field values to start this query after, in order of the query's order by. @@ -1101,7 +1103,8 @@ export namespace Firestore { * const querySnapshot = await firebase.firestore() * .collection('users') * .orderBy('age') - * .startAt(user); + * .startAt(user) + * .get(); * ``` * * > Cursor snapshot queries have limitations. Please see [Query limitations](/) for more information. @@ -1121,12 +1124,33 @@ export namespace Firestore { * const querySnapshot = await firebase.firestore() * .collection('users') * .orderBy('age') - * .startAt(30); + * .startAt(30) + * .get(); * ``` * * @param fieldValues The field values to start this query at, in order of the query's order by. */ startAt(...fieldValues: any[]): Query; + + /** + * Creates and returns a new Query with the additional filter that documents must contain the specified field and + * the value should satisfy the relation constraint provided. + * + * #### Example + * + * ```js + * // Get all users who's age is 30 or above + * const querySnapshot = await firebase.firestore() + * .collection('users') + * .where('age', '>=', 30); + * .get(); + * ``` + * + * @param fieldPath The path to compare. + * @param opStr The operation string (e.g "<", "<=", "==", ">", ">=", "array-contains"). + * @param value The comparison value. + */ + where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: any): Query; } /**