mongoose-encrypt-text

1.1.0 • Public • Published

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'
})

Readme

Keywords

Package Sidebar

Install

npm i mongoose-encrypt-text

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

3.12 kB

Total Files

5

Last publish

Collaborators

  • peek4y