between method

QueryPredicateOperation between(
  1. Comparable<T> start,
  2. Comparable<T> end
)

A between operation.

Matches models where the given field is between the provided start and end values.

Example:

The example returns Posts where the rating is between 5 and 10.

Amplify.DataStore.query(
 Post.classType,
 where: Post.RATING.between(5, 10),
);

Implementation

QueryPredicateOperation between(Comparable<T> start, Comparable<T> end) =>
    QueryPredicateOperation(
      fieldName,
      BetweenQueryOperator<Comparable<T>>(start, end),
    );