INNER CODE UNIT · JavaScript
urlTokens
fastify/fastify-mongodb · index.js:62
const urlTokens = /\w\/([^?]*)/g.exec(url)
const parsedDbName = urlTokens && urlTokens[1]
const databaseName = database || parsedDbName
const client = new MongoClient(url, opts)
await client.connect()
decorateFastifyInstance(fastify, client, {
newClient: true,
forceClose,
database: databaseName,
name
})
}
}
module.exports = fp(fastifyMongodb, {
fastify: '5.x',