Validatable — Documentation by YARD 0.9.37 (original) (raw)

Module: Mongo::Operation::ValidatablePrivate

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

Instance Method Summarycollapse

Instance Method Details

#validate_array_filters(connection, selector_or_item) ⇒ 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.

selector_or_item here is either:

58 59 60 61 62 63 64 # File 'lib/mongo/operation/shared/validatable.rb', line 58 def validate_array_filters(connection, selector_or_item) if selector_or_item.key?(:arrayFilters) && !connection.features.array_filters_enabled? then raise Error::UnsupportedArrayFilters end end

#validate_collation(connection, selector_or_item) ⇒ 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.

selector_or_item here is either:

69 70 71 72 73 74 75 # File 'lib/mongo/operation/shared/validatable.rb', line 69 def validate_collation(connection, selector_or_item) if selector_or_item.key?(:collation) && !connection.features.collation_enabled? then raise Error::UnsupportedCollation end end

#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

#validate_hint_on_update(connection, selector_or_item) ⇒ 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.

selector_or_item here is either:

47 48 49 50 51 52 53 # File 'lib/mongo/operation/shared/validatable.rb', line 47 def validate_hint_on_update(connection, selector_or_item) if selector_or_item.key?(:hint) && !connection.features.update_delete_option_validation_enabled? then raise Error::UnsupportedOption.hint_error end end

#validate_updates(connection, updates) ⇒ 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.

| 77 78 79 80 81 82 83 84 | # File 'lib/mongo/operation/shared/validatable.rb', line 77 def validate_updates(connection, updates) updates.each do |update| validate_array_filters(connection, update) validate_collation(connection, update) validate_hint_on_update(connection, update) end updates end | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |