title: MongoError: can't find any special indices: 2d (needs index), 2dsphere (needs index)
body: <p>I am attempting to use MongoDB's Geospatial Indexing by querying for latitude and longitude points around a certain point using MongoDB's find method. I keep getting the error:   </p>
  
  <blockquote>
    <p>MongoError: can't find any special indices: 2d (needs index), 2dsphere (needs index)</p>
  </blockquote>
  
  <p>I'm not sure where the documentation is for this after Googling for about an hour. Also I can't find any good explanations. Here is the Schema that I created using Mongoose:</p>
  
  <pre><code>var mongoose = require('mongoose');
  var Schema = mongoose.Schema;
  
  var EventSchema = new Schema ({
    name: String,
    description: String,
    location: {type: [String], index: '2dsphere'},
    time: Date,
    photo: Buffer,
    activity: String
  });
  
  mongoose.model('Event', EventSchema);
  </code></pre>
  
  <p>I then use the <em>find</em> method to find other <em>Event</em> documents around the point that the user provides.</p>
  
  <pre><code>var maxDistance = 0.09;
  var lonLat = {$geometry: {type: 'Point', coordinates: [34.09,124.34] }};
  
  Event.find({
    'geo': {
      $near: lonLat,
      $maxDistance: maxDistance
    }
  }).exec(function(err, events) {
    if(err) {
      throw err;
    } else {
      return events;
    }
  });
  </code></pre>
  
  <p>What syntax do I have wrong here? Am I missing something huge? Any urls to any documentation will be great as well besides <a href="http://docs.mongodb.org/manual/core/geospatial-indexes/" rel="nofollow">this link</a>.</p>