Query constructor
Query(
- HopDocClient client,
- dynamic index,
- Map<
String, dynamic> _compoundQuery, - String _field, {
- String? isEqualTo,
- int? isGreaterThan,
- int? isGreaterThanOrEqualTo,
- int? isLessThan,
- int? isLessThanOrEqualTo,
- String? contains,
- GeoDistanceQuery? isWithinRadius,
- GeoBoxQuery? isWithinBox,
- int? at,
- Document? after,
- int? limit,
- String? orderBy,
- bool addId = false,
- bool nanoDate = false,
Implementation
Query(
HopDocClient client,
index,
this._compoundQuery,
this._field, {
String? isEqualTo,
int? isGreaterThan,
int? isGreaterThanOrEqualTo,
int? isLessThan,
int? isLessThanOrEqualTo,
String? contains,
GeoDistanceQuery? isWithinRadius,
GeoBoxQuery? isWithinBox,
int? at,
Document? after,
int? limit,
String? orderBy,
this.addId = false,
this.nanoDate = false,
}) : assert((at == null || after == null) == true,
"You cannot set both at and after in start filter method on a query"),
super(client, index) {
if (isEqualTo != null) {
this._queryType = QueryType.IS_EQUAL_TO;
this._value = isEqualTo;
} else if (isGreaterThan != null) {
this._queryType = QueryType.IS_GREATER_THAN;
this._value = isGreaterThan;
} else if (isGreaterThanOrEqualTo != null) {
this._queryType = QueryType.IS_GREATER_THAN_OR_EQUAL_TO;
this._value = isGreaterThanOrEqualTo;
} else if (isLessThan != null) {
this._queryType = QueryType.IS_LESS_THAN;
this._value = isLessThan;
} else if (isLessThanOrEqualTo != null) {
this._queryType = QueryType.IS_LESS_THAN_OR_EQUAL_TO;
this._value = isLessThanOrEqualTo;
} else if (contains != null) {
this._queryType = QueryType.CONTAINS;
this._value = contains;
} else if (isWithinRadius != null) {
this._queryType = QueryType.IS_WITHIN_RADIUS;
this._value = isWithinRadius;
} else if (isWithinBox != null) {
this._queryType = QueryType.IS_WITHIN_BOX;
this._value = isWithinBox;
} else if (at != null) {
this._queryType = QueryType.START_AT;
this._value = at;
} else if (after != null) {
this._queryType = QueryType.START_AFTER;
this._value = after;
} else if (limit != null) {
this._queryType = QueryType.LIMIT;
this._value = limit;
} else if (orderBy != null) {
this._queryType = QueryType.ORDER_BY;
this._value = orderBy;
}
}