Method: MongoDoc::Contexts::Mongo#empty?
- Defined in:
- lib/mongo_doc/contexts/mongo.rb
#empty? ⇒ Boolean Also known as: blank?
Determine if the context is empty or blank given the criteria. Will perform a quick find_one asking only for the id.
Example:
context.blank?
77 78 79 |
# File 'lib/mongo_doc/contexts/mongo.rb', line 77 def empty? collection.find_one(selector, ).nil? end |