Class: Mongoid::Collections::Master

Inherits:
Object
  • Object
show all
Includes:
Retry
Defined in:
lib/mongoid/collections/master.rb

Overview

This class wraps the MongoDB master database.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Retry

#retry_on_connection_failure

Constructor Details

#initialize(master, name) ⇒ Master

Create the new database writer. Will create a collection from the master database.

Examples:

Create a new wrapped master.

Master.new(db, "testing")

Parameters:

  • master (Mongo::DB)

    The master database.

  • name (String)

    The name of the database.



32
33
34
# File 'lib/mongoid/collections/master.rb', line 32

def initialize(master, name)
  @collection = master.collection(name)
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



9
10
11
# File 'lib/mongoid/collections/master.rb', line 9

def collection
  @collection
end