123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Contextual::Queryable

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/mongoid/contextual/queryable.rb

Overview

Mixin module which adds methods to ::Mongoid::Criteria that indicate the criteria query result will be an empty set.

Instance Attribute Summary

Instance Attribute Details

#blank?true | false (readonly) Also known as: #empty?

Is the enumerable of matching documents empty?

Examples:

Is the context empty?

context.blank?

Returns:

  • (true | false)

    If the context is empty.

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 22

def blank?
  !exists?
end

#collection (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 14

attr_reader :collection, :criteria, :klass

#collection The collection to query against.(The collection to query against.) (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 14

attr_reader :collection, :criteria, :klass

#criteria (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 14

attr_reader :collection, :criteria, :klass

#criteria The criteria for the context.(The criteria for the context.) (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 14

attr_reader :collection, :criteria, :klass

#empty? (readonly)

Alias for #blank?.

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 25

alias :empty? :blank?

#klass (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 14

attr_reader :collection, :criteria, :klass

#klass The klass for the criteria.(The klass for the criteria.) (readonly)

[ GitHub ]

  
# File 'lib/mongoid/contextual/queryable.rb', line 14

attr_reader :collection, :criteria, :klass