123456789_123456789_123456789_123456789_123456789_

Module: Mongo::Operation::BypassDocumentValidation Private

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/mongo/operation/shared/bypass_document_validation.rb

Overview

Custom behavior for operations that support the bypassdocumentvalidation option.

Since:

  • 2.5.2

Instance Method Summary

Instance Method Details

#add_bypass_document_validation(sel) (private)

Since:

  • 2.5.2

[ GitHub ]

  
# File 'lib/mongo/operation/shared/bypass_document_validation.rb', line 40

def add_bypass_document_validation(sel)
  return sel unless bypass_document_validation
  sel.merge(bypassDocumentValidation: true)
end

#command(connection) (private)

Since:

  • 2.5.2

[ GitHub ]

  
# File 'lib/mongo/operation/shared/bypass_document_validation.rb', line 29

def command(connection)
  if Lint.enabled?
    unless connection.is_a?(Server::Connection)
      raise Error::LintError, "Connection is not a Connection instance: #{connection}"
    end
  end

  sel = super
  add_bypass_document_validation(sel)
end