Как зашифровать вспомогательные документы, исключая определенные поля в поддонах?Шифрование Mongoose
Я пытаюсь реализовать шифрование по схеме ниже, используя mongoose-encryption plugin. Моя родительская схема, то есть «parentSchema» получает зашифрованную, но не дочернюю схему. Мне нужно зашифровать «childSchema» и «childinformationSchema». Что мне здесь не хватает?
var childinformationSchema = new Schema({
otherwitnes: String,
reportedemployOther: String,
status: String,
updateddate: Date,
updatedby: String
});
childinformationSchema.plugin(encrypt, {
key: encryptionKey,
exclude: ['status', 'updateddate', 'updatedby']
});
var childSchema = new Schema({
childdata: {
childinformation: [childinformationSchema]
}
});
childSchema.plugin(encrypt.encryptedChildren, {
key: encryptionKey
});
var parentSchema = new Schema({
practicename: String,
createddate: Date,
createdby: String,
updateddate: Date,
updatedby: String,
patientrecordno: String,
state: String,
child: [childSchema]
});
parentSchema.plugin(
encrypt.encryptedChildren,
{
key: encryptionKey,
exclude: ['createddate', 'createdby', 'updateddate', 'updatedby', 'state', 'patientrecordno', 'child']
}
);
Любое тело, кто может мне помочь? – Praveen
Будьте терпеливы, кто-то с необходимыми знаниями в конечном итоге ответит. – joao
@joao, возможно, начнет щедрость? :) –