Add Polygon Type To Schema / PolygonContain to Query (#3944)
* Added type polygon to schema * refactoring and more tests * fix tests * update test and transform * add support for polygonContains * fix transform.mongoObjectToParseObject test * add indexes for polygon * index test * postgres test fix * remove invalid loop test * add invalid loop test * nit
This commit is contained in:
committed by
Florent Vilmart
parent
0571c6f95e
commit
e6cc8204b3
@@ -231,7 +231,8 @@ const validNonRelationOrPointerTypes = [
|
||||
'Array',
|
||||
'GeoPoint',
|
||||
'File',
|
||||
'Bytes'
|
||||
'Bytes',
|
||||
'Polygon'
|
||||
];
|
||||
// Returns an error suitable for throwing if the type is invalid
|
||||
const fieldTypeIsInvalid = ({ type, targetClass }) => {
|
||||
@@ -995,6 +996,11 @@ function getObjectType(obj) {
|
||||
return 'Bytes';
|
||||
}
|
||||
break;
|
||||
case 'Polygon' :
|
||||
if(obj.coordinates) {
|
||||
return 'Polygon';
|
||||
}
|
||||
break;
|
||||
}
|
||||
throw new Parse.Error(Parse.Error.INCORRECT_TYPE, "This is not a valid " + obj.__type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user