Socket
Socket
Sign inDemoInstall

mongoose-dedupe

Package Overview
Dependencies
233
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mongoose-dedupe


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

🦄 Mongoose dedupe

Status

Like uniqueness checking but on steroids. Check for individually unique fields, collectively unique queries and unique subdocument values all from within the mongoose Schema.

For Parents

PropDescription
dedupeUse this to lookup a single field value's uniqueness
dedupeWithRuns all properties with this flag in a query

For Subs

PropDescription
distinctUse this to make a sub-document value unique. If merge or accumulate options are not present in sibling options, then it will error on match.
mergeUse this to overwrite a sub-document property on match
accumulateUse this to add to a sub-document property on match

Additionally, you can pass an "options" property to the plugin to append query data to each lookup. This is useful if you're using another plugin, such as one that checks the "active" state of a document.

FAQs

Last updated on 28 Feb 2022

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