1.1.0 • Published 6 years ago
mongoose-encrypt-text v1.1.0
mongoose-encrypt-text
Mongoose Schema Type for storing encrypted (sha1 hash) text
Usage
const EncryptedText = require('mongoose-encrypt-text');
const mongoose = require('mongoose');
const MySchema = new mongoose.Schema({
encrypted_text: EncryptText
});
const MyModel = mongoose.model('MyModel', MySchema);
MyModel.create({ encrypted_text: 'test' }).then((doc) => {
console.log(doc.encrypted_text) // 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'
})