Method: Mongoid::Findable#exists?

Defined in:
lib/mongoid/findable.rb

#exists?Boolean

Returns true if there are on document in database based on the provided arguments.

Examples:

Do any documents exist for the conditions?

Person.exists?

Parameters:

  • args (Array)

    The conditions.

Returns:

Since:

  • 4.0.0



74
75
76
# File 'lib/mongoid/findable.rb', line 74

def exists?
  with_default_scope.exists?
end