Socket
Socket
Sign inDemoInstall

mongoose-immutable

Package Overview
Dependencies
47
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mongoose-immutable

Make immutable fields in Mongoose


Version published
Weekly downloads
177
decreased by-39.38%
Maintainers
1
Install size
6.72 MB
Created
Weekly downloads
 

Readme

Source

Mongoose Immutable

Allow your schemas to have immutable properties!

Install

npm install mongoose-immutable --save

Example

var testSchema = new Schema({
  testField: {type: String, immutable: true},
  testDefaultField: {type: String, default: 'test', immutable: true}
});
testSchema.plugin(immutablePlugin);

var Model = mongoose.model('Test', testSchema);
testModel = new Model({
  testField: 'test'
});

Now every attempt to change the value of those labeled immutable will be futile.

Enjoy

Keywords

FAQs

Last updated on 02 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc