Method: Mongoid::Contextual::Memory#second

Defined in:
lib/mongoid/contextual/memory.rb

#secondDocument

Get the second document in the database for the criteria’s selector.

Examples:

Get the second document.

context.second

Returns:



382
383
384
# File 'lib/mongoid/contextual/memory.rb', line 382

def second
  eager_load([documents.second]).first
end