123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Contextual::Command

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/mongoid/contextual/command.rb

Overview

Mixin module included in objects which represent database commands.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#collection (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/command.rb', line 12

attr_reader :collection, :criteria

#collection The collection to query against.(The collection to query against.) (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/command.rb', line 12

attr_reader :collection, :criteria

#criteria (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/command.rb', line 12

attr_reader :collection, :criteria

#criteria The criteria for the context.(The criteria for the context.) (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/command.rb', line 12

attr_reader :collection, :criteria

Instance Method Details

#clientMongo::Client

Get the database client.

Examples:

Get the client.

command.client

Returns:

  • (Mongo::Client)

    The Mongo client.

[ GitHub ]

  
# File 'lib/mongoid/contextual/command.rb', line 30

def client
  collection.database.client
end

#commandHash

The database command that is being built to send to the db.

Examples:

Get the command.

command.command

Returns:

  • (Hash)

    The db command.

[ GitHub ]

  
# File 'lib/mongoid/contextual/command.rb', line 20

def command
  @command ||= {}
end