Sha256: 8211e930e17e3a8e7d5b8ee4d9639ab27ea633effe612f6fc1e0113b65f94cea

Contents?: true

Size: 779 Bytes

Versions: 54

Compression:

Stored size: 779 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Contextual
    module Command

      # @attribute [r] collection The collection to query against.
      # @attribute [r] criteria The criteria for the context.
      attr_reader :collection, :criteria

      # The database command that is being built to send to the db.
      #
      # @example Get the command.
      #   command.command
      #
      # @return [ Hash ] The db command.
      #
      # @since 3.0.0
      def command
        @command ||= {}
      end

      # Get the database client.
      #
      # @example Get the client.
      #   command.client
      #
      # @return [ Mongo::Client ] The Mongo client.
      #
      # @since 3.0.0
      def client
        collection.database.client
      end
    end
  end
end

Version data entries

54 entries across 51 versions & 3 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/contextual/command.rb
mongoid-7.0.12 lib/mongoid/contextual/command.rb
mongoid-6.4.8 lib/mongoid/contextual/command.rb
mongoid-7.0.11 lib/mongoid/contextual/command.rb
mongoid-7.0.10 lib/mongoid/contextual/command.rb
mongoid-6.4.7 lib/mongoid/contextual/command.rb
mongoid-6.4.5 lib/mongoid/contextual/command.rb
mongoid-7.0.8 lib/mongoid/contextual/command.rb
mongoid-7.0.7 lib/mongoid/contextual/command.rb
mongoid-7.0.6 lib/mongoid/contextual/command.rb
mongoid-5.4.1 lib/mongoid/contextual/command.rb
mongoid-7.0.5 lib/mongoid/contextual/command.rb
mongoid-7.0.4 lib/mongoid/contextual/command.rb
mongoid-6.4.4 lib/mongoid/contextual/command.rb
mongoid-7.0.3 lib/mongoid/contextual/command.rb
mongoid-6.4.2 lib/mongoid/contextual/command.rb
mongoid-7.0.2 lib/mongoid/contextual/command.rb
mongoid-7.0.1 lib/mongoid/contextual/command.rb
mongoid-6.4.1 lib/mongoid/contextual/command.rb
mongoid-5.4.0 lib/mongoid/contextual/command.rb