2 // import the necessary modules
3 var mongoose = require('../../lib');
4 var Schema = mongoose.Schema;
6 // create an export function to encapsulate the model creation
7 module.exports = function() {
9 // NOTE : This object must conform *precisely* to the geoJSON specification
10 // you cannot embed a geoJSON doc inside a model or anything like that- IT
12 var LocationObject = new Schema({
19 LocationObject.index({loc: '2dsphere'});
21 mongoose.model('Location', LocationObject);