1.0.3 • Published 3 years ago
tuos-mongoose v1.0.3
tuos-mongoose
Tuos mongoose plugin
INSTALL
NPM
npm install tuos-mongoose
YARN
yarn add tuos-mongoose
USAGE
Register the plugin
const options = {
mongoose: {
// default connection
connect: 'mongodb://localhost:27017/tuos', // String or Object
// default options
options: {
useNewUrlParser: true,
config: {
autoIndex: true
},
useUnifiedTopology: true
}
}
}
fastify.register(require('tuos-mongoose'), options)
Access the mongoose instance
const mongoose = fastify.mongoose