Module: Mongoid::Contextual

Included in:
Criteria
Defined in:
lib/mongoid/contextual.rb,
lib/mongoid/contextual/none.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/text_search.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, Queryable Classes: FindAndModify, GeoNear, MapReduce, Memory, Mongo, None, TextSearch

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

Since:

  • 3.0.0



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

def context
  @context ||= create_context
end