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

Module: Mongo::BulkWrite::ValidatablePrivate

Overview

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.

Defines behavior around validations.

Instance Method Summarycollapse

Instance Method Details

#validate(name, document) ⇒ Hash, BSON::Document

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.

Validate the document.

| 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | # File 'lib/mongo/bulk_write/validatable.rb', line 43 def validate(name, document) validate_operation(name) validate_document(name, document) if document.respond_to?(:keys) && (document[:collation] || document[Operation::COLLATION]) @has_collation = true end if document.respond_to?(:keys) && document[:array_filters] @has_array_filters = true end if document.respond_to?(:keys) && document[:hint] @has_hint = true end end | | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |