nightroman / Mdbc

MongoDB Cmdlets for PowerShell
Apache License 2.0
141 stars 16 forks source link

Query: Does the client filed encryption client settings supported #88

Closed crkmanju closed 6 days ago

crkmanju commented 1 week ago

We are looking for connect to mongodb with encryption settings. Is ppwershell cmdlets supports the same.

nightroman commented 1 week ago

How do you connect form other clients? Can you use the same connection string and see if it works?

crkmanju commented 1 week ago

Referring to https://www.mongodb.com/docs/manual/core/csfle/fundamentals/automatic-encryption/#std-label-csfle-fundamentals-automatic-encryption

Autoencrytionoptions for client settings is what I was looking for

nightroman commented 1 week ago

I see, thank you. Then it is supported as much as the used C# driver supports it.

See

> get-help Connect-Mdbc

# use this
    Connect-Mdbc [[-Settings] <MongoClientSettings>] [[-DatabaseName] <String>] [[-CollectionName] <String>] [-ClientVariable <String>] [-CollectionVariable
    <String>] [-DatabaseVariable <String>] [-NewCollection] [<CommonParameters>]

You should manually create MongoClientSettings and pass it in Connect-Mdbc. This is more like C# coding but PowerShell lets you do this, mostly.

Please refer to the MongoDB C# driver docs for the details.

I can see that MongoClientSettings has the property public AutoEncryptionOptions AutoEncryptionOptions. I believe it looks like what you are looking for.

nightroman commented 1 week ago

I have also just updated the C# driver to the latest 2.30, just in case. https://www.powershellgallery.com/packages/Mdbc/6.7.4

crkmanju commented 1 week ago

Thank you will look into it