docs: function getModel(resource) {
      var name = resource.name;
  
      // if not already in the model cache, get it
      if (!cache.models[name]) {
          var schema = new mongoose.Schema(resource.fields, { collection: name });
  
          // loop through indexes and add them to the schema
          _.each(resource.indexes, function (idx) {
              schema.index(idx.fields, idx.options);
          });
  
          cache.models[name] = mongoose.model(name, schema);
      }
  
      return cache.models[name];
  }