Skip to content

Commit 804f1a2

Browse files
FLE documentation updates (#85)
* DOCSP-13918: [mongosh] FLE docs * DOCSP-13918: [mongosh] FLE docs * fixups * updates per review Co-authored-by: Steve Renaker <[email protected]>
1 parent 559eab5 commit 804f1a2

File tree

2 files changed

+144
-1
lines changed

2 files changed

+144
-1
lines changed

source/install.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ Procedure
6060
``mongosh`` from an archive instead, see
6161
:ref:`macos-install-archive`.
6262

63+
Considerations
64+
``````````````
65+
66+
``mongosh`` installed with Homebrew does not support
67+
:manual:`automatic client-side field level encryption
68+
</core/security-automatic-client-side-encryption/>`.
69+
70+
Procedure
71+
`````````
72+
6373
To install ``mongosh`` with Homebrew:
6474

6575
.. include:: /includes/steps/install-shell-macos-homebrew.rst

source/reference/methods.txt

Lines changed: 134 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,56 @@ Connection Methods
356356

357357
- Description
358358

359+
* - :method:`Mongo()`
360+
361+
- JavaScript constructor to instantiate a database connection from
362+
the ``mongo`` shell or from a JavaScript file.
363+
364+
The :method:`Mongo()` method has the following parameters:
365+
366+
.. list-table::
367+
:header-rows: 1
368+
:widths: 20 20 80
369+
370+
* - Parameter
371+
372+
- Type
373+
374+
- Description
375+
376+
* - ``host``
377+
378+
- string
379+
380+
- *Optional*
381+
382+
The connection string for the target database
383+
connection.
384+
385+
If omitted, :method:`Mongo` instantiates a connection to the
386+
localhost interface on the default port ``27017``.
387+
388+
* - ``ClientSideFieldLevelEncryptionOptions``
389+
390+
- Document
391+
392+
- *Optional*
393+
394+
.. versionadded:: 4.2
395+
396+
Configuration parameters for enabling
397+
:manual:`Client-Side Field Level Encryption
398+
</core/security-client-side-encryption>`.
399+
400+
``ClientSideFieldLevelEncryptionOptions`` overrides the
401+
existing client-side field level encryption configuration of
402+
the database connection. If omitted, :method:`Mongo()`
403+
inherits the client-side field level encryption configuration
404+
of the current database connection.
405+
406+
For documentation of usage and syntax, see
407+
:ref:`ClientSideFieldLevelEncryptionOptions`.
408+
359409
* - :method:`Mongo.getDB()`
360410

361411
- Returns a database object.
@@ -366,7 +416,7 @@ Connection Methods
366416

367417
* - :method:`Mongo.watch()`
368418

369-
- Opens a :manual:`change stream cursor </change-streams>` for a replica
419+
- Opens a :manual:`change stream cursor </changeStreams>` for a replica
370420
set or a sharded cluster to report on all its non-system collections
371421
across its databases, with the exception of the ``admin``, ``local``,
372422
and ``config`` databases.
@@ -691,6 +741,89 @@ standalone and replica set deployments.
691741

692742
- Returns the free cloud monitoring status for your deployment.
693743

744+
Client-Side Field Level Encryption Methods
745+
------------------------------------------
746+
747+
.. note:: Limitations
748+
749+
- Automatic encryption is only available when ``mongosh`` is connected
750+
to an Atlas cluster or a MongoDB Enterprise Server. For details,
751+
see :manual:`Automatic Client-Side Field Level Encryption
752+
</core/security-automatic-client-side-encryption/>`. The methods
753+
listed in this section are used for *manual* encryption, and are
754+
supported on non-enterprise servers.
755+
756+
- Automatic encryption is not available with the Homebrew installation
757+
of ``mongosh``.
758+
759+
- Field level encryption is only available in the ``mongosh`` binary,
760+
and not available in the :compass:`embedded Compass shell
761+
</embedded-shell>`.
762+
763+
.. list-table::
764+
:widths: 30 70
765+
:header-rows: 1
766+
767+
* - Method
768+
769+
- Description
770+
771+
* - :method:`ClientEncryption.decrypt()`
772+
773+
- Decrypts the specified ``encryptedValue`` if the current database
774+
connection was configured with access to the Key Management Service
775+
(KMS) and key vault used to encrypt ``encryptedValue``.
776+
777+
* - :method:`ClientEncryption.encrypt()`
778+
779+
- Encrypts the specified value using the specified ``encryptionKeyId``
780+
and ``encryptionAlgorithm``.
781+
782+
* - :method:`getClientEncryption()`
783+
784+
- Returns the ``ClientEncryption`` object for the current database
785+
collection.
786+
787+
* - :method:`getKeyVault()`
788+
789+
- Returns the ``KeyVault`` object for the current database connection.
790+
791+
* - :method:`KeyVault.addKeyAlternateName()`
792+
793+
- Adds the ``keyAltName`` to the ``keyAltNames`` array of the data
794+
encryption key with the specified UUID.
795+
796+
* - :method:`KeyVault.createKey()`
797+
798+
- Adds a data encryption key to the key vault associated to the
799+
database connection.
800+
801+
* - :method:`KeyVault.deleteKey()`
802+
803+
- Deletes a data encryption key with the specified UUID from the key
804+
vault associated to the database connection.
805+
806+
* - :method:`KeyVault.getKey()`
807+
808+
- Gets a data encryption key with the specified UUID. The data
809+
encryption key must exist in the key vault associated to the
810+
database connection.
811+
812+
* - :method:`KeyVault.getKeyByAltName()`
813+
814+
- Gets all data encryption keys with the specified ``keyAltName``.
815+
816+
* - :method:`KeyVault.getKeys()`
817+
818+
- Returns all data encryption keys stored in the key vault associated
819+
to the database connection.
820+
821+
* - :method:`KeyVault.removeKeyAlternateName()`
822+
823+
- Removes the specified ``keyAltName`` from the data encryption key
824+
with the specified UUID. The data encryption key must exist in the
825+
key vault associated to the database connection.
826+
694827
Native Methods
695828
--------------
696829

0 commit comments

Comments
 (0)