title: Mongoose - how to add 2dsphere index on custom type?
body: <p>I'm using Mongoose with <a href="https://github.com/RideAmigosCorp/mongoose-geojson-schema" rel="nofollow">Mongoose-geojson-schema</a> however I cannot add <code>2dsphere</code> index on my field:</p>
  
  <pre><code>new Schema({
    district: {
      type: String,
      trim: true,
      unique: true,
      required: true
    },
    area: {
      type: GeoJSON.FeatureCollection,
      index: '2dsphere'
    }
  });
  </code></pre>
  
  <p>Getting such error:</p>
  
  <pre><code>/Users/dmitri/api/node_modules/mongoose/lib/schema.js:479
     throw new TypeError('Undefined type `' + name + '` at `' + path +
        ^
  TypeError: Undefined type `2dsphere` at `area.index`
     Did you try nesting Schemas? You can only nest using refs or arrays.
  </code></pre>