// import the necessary modulesvarmongoose=require('../../lib');varSchema=mongoose.Schema;// create an export function to encapsulate the model creationmodule.exports=function(){// define schema// NOTE : This object must conform *precisely* to the geoJSON specification// you cannot embed a geoJSON doc inside a model or anything like that- IT// MUST BE VANILLAvarLocationObject=newSchema({loc:{type:{type:String},coordinates:[]}});// define the indexLocationObject.index({loc:'2dsphere'});mongoose.model('Location',LocationObject);};