Module: Mongo::Model::QueryMixin

Defined in:
lib/mongo/model/query_mixin.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#exists?(options = {}) ⇒ Boolean Also known as: exist?

Returns:



2
3
4
# File 'lib/mongo/model/query_mixin.rb', line 2

def exists? options = {}
  self.class.count({id: id}, options) > 0
end