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
@@ -145,13 +145,25 @@ describe('parseObjectToMongoObjectForCreate', () => {
|
||||
});
|
||||
|
||||
it('geopoint', (done) => {
|
||||
var input = {location: [180, -180]};
|
||||
var input = {location: [45, -45]};
|
||||
var output = transform.mongoObjectToParseObject(null, input, {
|
||||
fields: { location: { type: 'GeoPoint' }},
|
||||
});
|
||||
expect(typeof output.location).toEqual('object');
|
||||
expect(output.location).toEqual(
|
||||
{__type: 'GeoPoint', longitude: 180, latitude: -180}
|
||||
{__type: 'GeoPoint', longitude: 45, latitude: -45}
|
||||
);
|
||||
done();
|
||||
});
|
||||
|
||||
it('polygon', (done) => {
|
||||
var input = {location: { type: 'Polygon', coordinates: [[[45, -45],[45, -45]]]}};
|
||||
var output = transform.mongoObjectToParseObject(null, input, {
|
||||
fields: { location: { type: 'Polygon' }},
|
||||
});
|
||||
expect(typeof output.location).toEqual('object');
|
||||
expect(output.location).toEqual(
|
||||
{__type: 'Polygon', coordinates: [[45, -45],[45, -45]]}
|
||||
);
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user