Module: Mongoid::Contextual

Extended by:
Forwardable
Included in:
Criteria
Defined in:
build/mongoid-master/lib/mongoid/contextual.rb,
build/mongoid-master/lib/mongoid/contextual/none.rb,
build/mongoid-master/lib/mongoid/contextual/mongo.rb,
build/mongoid-master/lib/mongoid/contextual/atomic.rb,
build/mongoid-master/lib/mongoid/contextual/memory.rb,
build/mongoid-master/lib/mongoid/contextual/command.rb,
build/mongoid-master/lib/mongoid/contextual/geo_near.rb,
build/mongoid-master/lib/mongoid/contextual/queryable.rb,
build/mongoid-master/lib/mongoid/contextual/aggregable.rb,
build/mongoid-master/lib/mongoid/contextual/map_reduce.rb,
build/mongoid-master/lib/mongoid/contextual/aggregable/none.rb,
build/mongoid-master/lib/mongoid/contextual/aggregable/mongo.rb,
build/mongoid-master/lib/mongoid/contextual/aggregable/memory.rb

Defined Under Namespace

Modules: Aggregable, Atomic, Command, Queryable Classes: GeoNear, MapReduce, Memory, Mongo, None

Instance Method Summary collapse

Instance Method Details

#contextMemory, Mongo

Get the context in which criteria queries should execute. This is either in memory (for embedded documents) or mongo (for root level documents.)

Examples:

Get the context.

criteria.context

Returns:



34
35
36
# File 'build/mongoid-master/lib/mongoid/contextual.rb', line 34

def context
  @context ||= create_context
end