Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nikic/mongoose-query-builder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nikic/mongoose-query-builder

A useful library to help build meaningful and bug free mongoose queries

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mongoose Query Builder

Writing mongoose queries whilst allowing optional parameters can be quite problematic for Mongo and Mongoose to handle alone. Example, you have an HTTP API that accepts multiple query params, one of these params being "HouseNumber" and the other "PostalCode".

Lets assume HouseNumber was never specified in the HTTP request but PostalCode was.

Without MGB your Mongo query look like this { "HouseNumber": null, "PostalCode": "ABC DEF" }

With MGB your Mongo query looks like this { "PostalCode": "ABC DEF" }

In short, unless you plan on writing an IF statement for each optional query field then MGB is perfect for you!

FAQs

Package last updated on 11 Jun 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc