Method: Mongo::Crypt::AutoEncrypter#encrypt

Defined in:
lib/mongo/crypt/auto_encrypter.rb

#encrypt(database_name, command, timeout_holder) ⇒ 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.

Encrypt a database command.

Parameters:

  • database_name (String)

    The name of the database on which the command is being run.

  • command (Hash)

    The command to be encrypted.

Returns:

  • (BSON::Document)

    The encrypted command.



190
191
192
193
194
195
196
197
# File 'lib/mongo/crypt/auto_encrypter.rb', line 190

def encrypt(database_name, command, timeout_holder)
  AutoEncryptionContext.new(
    @crypt_handle,
    @encryption_io,
    database_name,
    command
  ).run_state_machine(timeout_holder)
end