Method: Mongoid::Collections::Master#initialize

Defined in:
lib/mongoid/collections/master.rb

#initialize(master, name, options = {}) ⇒ 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.

  • options (Hash) (defaults to: {})

    The collection options.

Options Hash (options):

  • :capped (true, false)

    If the collection is capped.

  • :size (Integer)

    The capped collection size.

  • :max (Integer)

    The maximum number of docs in the capped collection.



40
41
42
# File 'lib/mongoid/collections/master.rb', line 40

def initialize(master, name, options = {})
  @collection = master.create_collection(name, options)
end