我正试图在邻近的美国境内的MongoDB中找到位置。为此,我使用查询“withinPolygon”和美国周围的矩形。不完全,但应该工作:)我得到的反应是'坏约束:$ geoWithin'(代码107)
好奇,如果其他人使用“withinPolygon”查询,如果有什么我做错了?
这是基本代码:
$query = new Parse\ParseQuery( "Church" );
$nwCornerContiguous = new Parse\ParseGeoPoint( $top, $left );
$neCornerContiguous = new Parse\ParseGeoPoint( $top, $right );
$swCornerContiguous = new Parse\ParseGeoPoint( $bottom, $left );
$seCornerContiguous = new Parse\ParseGeoPoint( $bottom, $right );
$query->withinPolygon( "locationGeopoint",
array( $nwCornerContiguous, $neCornerContiguous, $swCornerContiguous,
$seCornerContiguous ) );
$results = $query->find();
“ofPolygon”功能已添加到Parse Server版本2.5中