where method

QueryReference where(
  1. String fieldPath, {
  2. dynamic isEqualTo,
  3. dynamic isLessThan,
  4. dynamic isLessThanOrEqualTo,
  5. dynamic isGreaterThan,
  6. dynamic isGreaterThanOrEqualTo,
  7. dynamic arrayContains,
  8. List? arrayContainsAny,
  9. List? whereIn,
  10. bool isNull = false,
})

Implementation

QueryReference where(
  String fieldPath, {
  dynamic isEqualTo,
  dynamic isLessThan,
  dynamic isLessThanOrEqualTo,
  dynamic isGreaterThan,
  dynamic isGreaterThanOrEqualTo,
  dynamic arrayContains,
  List<dynamic>? arrayContainsAny,
  List<dynamic>? whereIn,
  bool isNull = false,
}) {
  if (isEqualTo != null) {
    _addFilter(fieldPath, isEqualTo,
        operator: StructuredQuery_FieldFilter_Operator.EQUAL);
  }
  if (isLessThan != null) {
    _addFilter(fieldPath, isLessThan,
        operator: StructuredQuery_FieldFilter_Operator.LESS_THAN);
  }
  if (isLessThanOrEqualTo != null) {
    _addFilter(fieldPath, isLessThanOrEqualTo,
        operator: StructuredQuery_FieldFilter_Operator.LESS_THAN_OR_EQUAL);
  }
  if (isGreaterThan != null) {
    _addFilter(fieldPath, isGreaterThan,
        operator: StructuredQuery_FieldFilter_Operator.GREATER_THAN);
  }
  if (isGreaterThanOrEqualTo != null) {
    _addFilter(fieldPath, isGreaterThanOrEqualTo,
        operator: StructuredQuery_FieldFilter_Operator.GREATER_THAN_OR_EQUAL);
  }
  if (arrayContains != null) {
    _addFilter(fieldPath, arrayContains,
        operator: StructuredQuery_FieldFilter_Operator.ARRAY_CONTAINS);
  }
  if (arrayContainsAny != null) {
    _addFilter(fieldPath, arrayContainsAny,
        operator: StructuredQuery_FieldFilter_Operator.ARRAY_CONTAINS_ANY);
  }
  if (whereIn != null) {
    _addFilter(fieldPath, whereIn,
        operator: StructuredQuery_FieldFilter_Operator.IN);
  }
  if (isNull) {
    _addFilter(fieldPath, null);
  }

  return this;
}