New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wassimbenzarti/fastify-mongoose

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wassimbenzarti/fastify-mongoose

Fastify Mongoose connection plugin

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

fastify-mongoose

js-standard-style

Under the hood mongoose ODM is used, the options that you pass to register will be passed to the Mongoose connection. Pass the uri option is required.

Install

npm i fastify-mongoose --save

Usage

Add it to you project with register and you are done! You can access the Mongoose Connection via fastify.mongo.db and ObjectId via fastify.mongo.ObjectId.

const fastify = require('fastify')

fastify.register(require('fastify-mongoose'), {
  uri: 'mongodb://localhost/test_db'
})

fastify.listen(3000, err => {
  if (err) throw err
  console.log(`server listening on ${fastify.server.address().port}`)
})
Breaking changes

"version": "0.3.0 and above plugin have ability to open connection with multiple different databases, for achieving this functionality it have to stop using default mongoose connection. Onward please use db client returned by this plugin.

License

Licensed under MIT.

Keywords

FAQs

Package last updated on 26 Jul 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