Trying to follow the mongo client side field level encryption tutorials but I’m struggling to get the schema working with the keyID field.
See below for my JS command.
I’m receiving this error “Array elements must have type BinData, found object” with code 51088.
I’m interpreting this as the keyID is not an array of UUID but I can’t find any information on how to get around this.
db.createCollection("users", {
validator: {
$jsonSchema: {
bsonType: "object",
properties: {
date_of_birth: {
encrypt: {
keyId: [{
"$binary": {
base64: "%s",
subType: "04"
}
}],
bsonType: "string",
algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
}
},
}
}
}
});