Module: Mongo::Model::QueryMixin
- Defined in:
- lib/mongo/model/query_mixin.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #exists?(options = {}) ⇒ Boolean (also: #exist?)
Instance Method Details
#exists?(options = {}) ⇒ Boolean Also known as: exist?
2 3 4 |
# File 'lib/mongo/model/query_mixin.rb', line 2 def exists? = {} self.class.count({id: id}, ) > 0 end |