Method: MongoMapper::Document::ClassMethods#first

Defined in:
lib/mongo_mapper/document.rb

#first(options = {}) ⇒ Object

Returns the first document in the ordered collection as described by options.

Parameters:

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

    any conditions understood by FinderOptions.to_mongo_criteria

Returns:

  • the first document in the ordered collection as described by options

See Also:



101
102
103
# File 'lib/mongo_mapper/document.rb', line 101

def first(options={})
  find_one(options)
end