Method: Mongoid::Contextual::Memory#length

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

#lengthInteger Also known as: size

Get the length of matching documents in the context.

Examples:

Get the length of matching documents.

context.length

Returns:

  • (Integer)

    The matching length.



234
235
236
# File 'lib/mongoid/contextual/memory.rb', line 234

def length
  documents.length
end