The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/firestore > lite > where

where() function

Creates a QueryConstraint that enforces that documents must contain the specified field and that the value should satisfy the relation constraint provided.

Signature:

export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;

Parameters

Parameter Type Description
fieldPath string | FieldPath The path to compare
opStr WhereFilterOp The operation string (e.g "<", "<=", "==", "<", "<=", "!=").
value unknown The value for comparison

Returns:

QueryConstraint

The created Query.