I have a requirement to implement client side field level encryption, and I implemented it using the Automatic Encryption provided by MongoDB, now I have to update the schema of an existing collection and need to encrypt the existing data in the field, for that I need to find weather the field is encrypted or not, how can I achieve it.
This is my schema
{
$jsonSchema: {
bsonType: 'object',
properties: {
title: {
bsonType: 'string'
},
author: {
bsonType: 'string'
},
category: {
bsonType: 'string'
},
name: {
encrypt: {
bsonType: 'string',
keyId: [
{
$binary: {
base64: 'pDxBjDM2RcKbaDugcRHvPg==',
subType: '04'
}
}
],
algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
}
}
}
}
}
I am unable to find any lead, as I am a beginner to MongoDB.