fix(Postgres): Support for GeoPoint equality query (#3875)

* Postgres doesn't support this query type yet

* removing conflict

* near test

* remove trailing space
This commit is contained in:
Diamond Lewis
2017-05-28 19:42:51 -05:00
committed by Florent Vilmart
parent bd2ea87c1d
commit b692e8578d
2 changed files with 38 additions and 1 deletions

View File

@@ -402,6 +402,12 @@ const buildWhereClause = ({ schema, query, index }) => {
index += 2;
}
if (fieldValue.__type === 'GeoPoint') {
patterns.push('$' + index + ':name ~= POINT($' + (index + 1) + ', $' + (index + 2) + ')');
values.push(fieldName, fieldValue.longitude, fieldValue.latitude);
index += 3;
}
Object.keys(ParseToPosgresComparator).forEach(cmp => {
if (fieldValue[cmp]) {
const pgComparator = ParseToPosgresComparator[cmp];