/geo-paging-example

Example of using MongoDB's new $minDistance option for paging through geo results.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

geo-paging-example

Example of using MongoDB's new minDistance option for paging through geo results. Pages through search results for sidewalk cafés near your address.

(Café data from NYC Open Data.)

Read my blog post describing the technique.

Setup

Install and run a local MongoDB server, at least version 2.5.1.

(Pre-2.5.1 MongoDB versions ignore minDistance, so this paging technique won't work with them.)

Install the Python packages in requirements.txt.

Run python load_cafes.py from the project directory.

Follow the instructions to get a Google API key, and place it in a file called google_api_key.txt.

Run

Run python server.py from the project directory.

About

Author: A. Jesse Jiryu Davis

Contributors: Gianfranco Palumbo