Method: Mongoid::Collections::ClassMethods#db

Defined in:
lib/mongoid/collections.rb

#dbMongo::DB

Return the database associated with this collection.

Examples:

Get the database object.

Model.db

Returns:

  • (Mongo::DB)

    The Mongo daatabase object.



66
67
68
# File 'lib/mongoid/collections.rb', line 66

def db
  collection.db
end