You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All other (unsupported) operations are implemented as dummy pass-through methods, because MongoDB does not use a predefined schema. Read more about the schema builder on http://laravel.com/docs/schema
240
240
241
+
### Geospatial indexes
242
+
243
+
Geospatial indexes are handy for querying location-based documents. They come in two forms: `2d` and `2dsphere`. Use the schema builder to add these to a collection.
244
+
245
+
To add a `2d` index:
246
+
247
+
```php
248
+
Schema::create('users', function($collection)
249
+
{
250
+
$collection->geospatial('name', '2d');
251
+
});
252
+
```
253
+
254
+
To add a `2dsphere` index:
255
+
256
+
```php
257
+
Schema::create('users', function($collection)
258
+
{
259
+
$collection->geospatial('name', '2dsphere');
260
+
});
261
+
```
262
+
241
263
Extensions
242
264
----------
243
265
@@ -274,7 +296,7 @@ If you want to use MongoDB to handle failed jobs, change the database in `config
Matches documents that satisfy a JavaScript expression. For more information check http://docs.mongodb.org/manual/reference/operator/query/where/#op._S_where
0 commit comments