Class: Mongoid::Criterion::Complex

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid_spacial/criterion/complex.rb

Overview

Complex criterion are used when performing operations on symbols to get get a shorthand syntax for where clauses.

Example:

{ :field => { "$lt" => "value" } } becomes: { :field.lt => "value }

Direct Known Subclasses

NearSpacial, WithinSpacial

Instance Method Summary collapse

Instance Method Details

#to_mongo_query(v) ⇒ Object



14
15
16
# File 'lib/mongoid_spacial/criterion/complex.rb', line 14

def to_mongo_query v
  {"$#{operator}" => v}
end