Module Mongoid::Extensions::Hash::CriteriaHelpers
In: lib/mongoid/extensions/hash/criteria_helpers.rb

Expands complex criterion into mongodb selectors.

Methods

Public Instance methods

Expand the complex criteria into a MongoDB compliant selector hash.

@example Convert the criterion.

  {}.expand_complex_criteria

@return [ Hash ] The mongo selector.

@since 1.0.0

Get the id attribute from this hash, whether it‘s prefixed with an underscore or is a symbol.

@example Extract the id.

  { :_id => 1 }.extract_id

@return [ Object ] The value of the id.

@since 2.3.2

[Validate]