Module | Mongoid::Matchers::Strategies |
In: |
lib/mongoid/matchers/strategies.rb
|
This module is responsible for returning the correct matcher given a MongoDB query expression.
MATCHERS | = | { "$all" => Matchers::All, "$and" => Matchers::And, "$exists" => Matchers::Exists, "$gt" => Matchers::Gt, "$gte" => Matchers::Gte, "$in" => Matchers::In, "$lt" => Matchers::Lt, "$lte" => Matchers::Lte, "$ne" => Matchers::Ne, "$nin" => Matchers::Nin, "$or" => Matchers::Or, "$size" => Matchers::Size |
Get the matcher for the supplied key and value. Will determine the class name from the key.
@example Get the matcher.
document.matcher(:title, { "$in" => [ "test" ] })
@param [ Document ] document The document to check. @param [ Symbol, String ] key The field name. @param [ Object, Hash ] The value or selector.
@return [ Matcher ] The matcher.
@since 2.0.0.rc.7