Skip to content

Instantly share code, notes, and snippets.

@meghangill
Created February 27, 2015 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save meghangill/9da9505374d2287ecb89 to your computer and use it in GitHub Desktop.
Save meghangill/9da9505374d2287ecb89 to your computer and use it in GitHub Desktop.
<?php
$c = (new MongoClient())->demo->points;
$c->find( [
'loc' => [
'$geoWithin' => [
'type' => 'Polygon',
'coordinates' => [ [
[ -0.91, 51.74 ],
[ -0.91, 51.27 ],
[ 0.67, 51.27 ],
[ 0.67, 51.74 ],
[ -0.91, 51.74 ]
] ],
'crs' => [
'type' => 'name',
'properties' => [
'name' => 'urn:x-mongodb:crs:strictwinding:EPSG:4326'
]
]
]
]
] );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment