Click or drag to resize

ClientEncryptionCreateEncryptedCollection Method (IMongoDatabase, String, CreateCollectionOptions, String, DataKeyOptions, CancellationToken)

Note: This API is now obsolete.

Create encrypted collection.

Namespace:  MongoDB.Driver.Encryption
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.22.0+75246110ed1247226fcc7f8eb2c54ffab745693e
Syntax
[ObsoleteAttribute("Use the overload with masterKey instead.")]
public CreateEncryptedCollectionResult CreateEncryptedCollection(
	IMongoDatabase database,
	string collectionName,
	CreateCollectionOptions createCollectionOptions,
	string kmsProvider,
	DataKeyOptions dataKeyOptions,
	CancellationToken cancellationToken = default
)

Parameters

database
Type: MongoDB.DriverIMongoDatabase
The database.
collectionName
Type: SystemString
The collection name.
createCollectionOptions
Type: MongoDB.DriverCreateCollectionOptions
The create collection options.
kmsProvider
Type: SystemString
The kms provider.
dataKeyOptions
Type: MongoDB.Driver.EncryptionDataKeyOptions
The datakey options.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: CreateEncryptedCollectionResult
The operation result.
Remarks
If EncryptionFields contains a keyId with a null value, a data key will be automatically generated and returned in EncryptedFields.
See Also