npm install fastify-mongo-memory --save
fastify.register(require('fastify-mongo-memory'), options, err => console.error(err));
fastify.get('/', (request, reply) => {
console.log(fastify.mongo); // Mongo in memory DB
});
Mongo in memory DB configuration JSON object.
{
"port": 5000 /* 8000 by default */
"dbname": "database-test-name"
}
Licensed under MIT.