Module: Mongoid::Spacial::Document::ClassMethods

Defined in:
lib/mongoid_spacial/spacial/document.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#spacial_index(name, *options) ⇒ Object

create spacial index for given field

Parameters:

  • name (String, Symbol)
  • options (Hash)

    options for spacial_index



17
18
19
20
# File 'lib/mongoid_spacial/spacial/document.rb', line 17

def spacial_index name, *options
  self.spacial_fields_indexed << name
  index [[ name, ::Mongo::GEO2D ]], *options
end