ClientEncryptionCreateEncryptedCollectionAsync Method |
Create encrypted collection.
Namespace:
MongoDB.Driver.Encryption
Assembly:
MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.19.1+3a2a09dd959482f665ffbb5df2557ec541597af4
Syntax public Task<CreateEncryptedCollectionResult> CreateEncryptedCollectionAsync(
IMongoDatabase database,
string collectionName,
CreateCollectionOptions createCollectionOptions,
string kmsProvider,
DataKeyOptions dataKeyOptions,
CancellationToken cancellationToken = default
)
Public Function CreateEncryptedCollectionAsync (
database As IMongoDatabase,
collectionName As String,
createCollectionOptions As CreateCollectionOptions,
kmsProvider As String,
dataKeyOptions As DataKeyOptions,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of CreateEncryptedCollectionResult)
member CreateEncryptedCollectionAsync :
database : IMongoDatabase *
collectionName : string *
createCollectionOptions : CreateCollectionOptions *
kmsProvider : string *
dataKeyOptions : DataKeyOptions *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> Task<CreateEncryptedCollectionResult>
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:
TaskCreateEncryptedCollectionResultThe operation result.
Remarks
if EncryptionFields contains a keyId with a null value, a data key will be automatically generated and assigned to keyId value.
See Also