PHP and MongoDB, Geospatial query example

Опубликовано: 10 Март 2026
на канале: 26 Brains
2,421
8

This video demonstrates how to use a vanilla MongoDB installation to create a collection of objects and search them using a '2dsphere' index.

Code can be found here:
https://bitbucket.org/damienhampton/p...

In the example, I am creating a directory of services for health related organisations.

This is only a basic demonstration of how to hang things together - I hope it helps.

Stuff used and referenced:

PHP: http://php.net
MongoDB: https://www.mongodb.com
PHP Mongo extension: http://php.net/manual/en/book.mongo.php
MongoDB 2dsphere index: http://docs.mongodb.org/manual/tutori...