ptah-encryption
v1.0.6
Published
**mongoose-field-encryption 重构**
Downloads
1
Readme
ptah-encryption
mongoose-field-encryption 重构
Email: [email protected]
BUILD WIDTH: 使用mongoose-field-encryption mongodb字段加密
Build Setup
npm install ptah-encryption
使用
const mongooseFieldEncryption = require('ptah-encryption');
const EmployeesSchema = new Schema(
{
'hkid': {type: String},
'payrollDate': {type: Date},
'realWages': {type: Number}
}
)
EmployeesSchema.plugin(mongooseFieldEncryption, {fields: ['hkid'], secret: encryptionKey}); //secret加載秘鈅 hkid:需要加密字段