ptah-encryption

1.0.6 • Public • Published

ptah-encryption

mongoose-field-encryption 重构

Email: lizizhen@cisystemsolutions.com

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:需要加密字段

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ptah-encryption

    Weekly Downloads

    21

    Version

    1.0.6

    License

    ISC

    Unpacked Size

    16.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • crycime