Method: Mongo::Operation::Validatable#validate_find_options

Defined in:
lib/mongo/operation/shared/validatable.rb

#validate_find_options(connection, selector) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/mongo/operation/shared/validatable.rb', line 24

def validate_find_options(connection, selector)
  if selector.key?(:hint) &&
    !connection.features.find_and_modify_option_validation_enabled?
  then
    raise Error::UnsupportedOption.hint_error
  end

  if selector.key?(:arrayFilters) &&
    !connection.features.array_filters_enabled?
  then
    raise Error::UnsupportedArrayFilters
  end

  if selector.key?(:collation) &&
    !connection.features.collation_enabled?
  then
    raise Error::UnsupportedCollation
  end
end