FB4D Reference IQueryFilter - SchneiderInfosystems/FB4D GitHub Wiki

Interface IQueryFilter

This interface allows creating a filter query to build a structured query in order to retrieve data from the Firestore Database. The interface will be created by the following class functions for all supported field types.

class function IntegerFieldFilter(const WhereFieldPath: string;
  WhereOperator: TWhereOperator; WhereValue: integer): IQueryFilter;

class function DoubleFieldFilter(const WhereFieldPath: string;
  WhereOperator: TWhereOperator; WhereValue: double): IQueryFilter;

class function StringFieldFilter(const WhereFieldPath: string;
  WhereOperator: TWhereOperator; const WhereValue: string): IQueryFilter;

class function BooleanFieldFilter(const WhereFieldPath: string;
  WhereOperator: TWhereOperator; WhereValue: boolean): IQueryFilter;

class function TimestampFieldFilter(const WhereFieldPath: string;
  WhereOperator: TWhereOperator; WhereValue: TDateTime): IQueryFilter; 

As where-operator, Firestore supports only the following operators: <, <=,>, >=, =, <>, Array-Contains, ArrayContainsAny, InArray, NotInArray

TWhereOperator = (woUnspecific, woLessThan, woLessThanOrEqual,
    woGreaterThan, woGreaterThanOrEqual, woEqual, woNotEqual, 
    woArrayContains, woInArray, woArrayContainsAny, woNotInArray);

Be aware that the NotEqual operator currently can apply only on one field only. For using the Array-Contains operator see also this blog Firebase Blog: Better Arrays in Firestore

You need nothing else than listed class functions from the interface IQueryFilter.

For further information about queries see also Google's Firestore Documentation: Query Operators

⚠️ **GitHub.com Fallback** ⚠️