Skip to content

Commit

Permalink
refactor(GeoQuery): where() -> startAt()
Browse files Browse the repository at this point in the history
  • Loading branch information
Daan committed Jan 21, 2019
1 parent cfe71f1 commit 51be1b2
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/GeoQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class GeoQuery {
private _limit: number;
private _radius: number;
private _isWeb: boolean;
private _ineq = false;

/**
* @param _query The `Query` instance.
Expand Down Expand Up @@ -140,8 +139,6 @@ export class GeoQuery {
opStr: GeoFirestoreTypes.WhereFilterOp,
value: any
): GeoQuery {
// True if inequality filter is used
this._ineq = (opStr !== '==' && opStr !== 'array-contains') ? true : this._ineq;
// Return GeoQuery
return new GeoQuery(this._query.where((fieldPath ? ('d.' + fieldPath) : fieldPath), opStr, value), this._queryCriteria);
}
Expand All @@ -161,9 +158,6 @@ export class GeoQuery {
// decode the geohash query string
const query: string[] = this._stringToQuery(toQueryStr);
// Create the Firebase query
if(!this._ineq){
return this._query.where('g', '>=', query[0]).where('g', '<=', query[1]) as GeoFirestoreTypes.web.Query;
}
return this._query.orderBy('g').startAt(query[0]).endAt(query[1]) as GeoFirestoreTypes.web.Query;
});
}
Expand Down

0 comments on commit 51be1b2

Please sign in to comment.