Module: Mongoid::Contextual

Included in:
Criteria
Defined in:
lib/mongoid/contextual.rb,
lib/mongoid/contextual/eager.rb,
lib/mongoid/contextual/mongo.rb,
lib/mongoid/contextual/atomic.rb,
lib/mongoid/contextual/memory.rb,
lib/mongoid/contextual/command.rb,
lib/mongoid/contextual/geo_near.rb,
lib/mongoid/contextual/queryable.rb,
lib/mongoid/contextual/map_reduce.rb,
lib/mongoid/contextual/find_and_modify.rb,
lib/mongoid/contextual/aggregable/mongo.rb,
lib/mongoid/contextual/aggregable/memory.rb

Defined Under Namespace

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

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:

Since:

  • 3.0.0



33
34
35
# File 'lib/mongoid/contextual.rb', line 33

def context
  @context ||= create_context
end