Skip to content

modernpoacher/catbox-mongodb

 
 

Repository files navigation

@modernpoacher/catbox-mongodb

A MongoDB adapter for catbox.

@modernpoacher/catbox-mongodb serializes values to BSON using the MongoDB driver.

This adapter supports Object, Array, Number, String, Date, and RegExp data types.

Installation

Install @modernpoacher/catbox-mongodb via NPM.

@modernpoacher/catbox-mongodb requires catbox:

npm i @hapi/catbox @modernpoacher/catbox-mongodb

Options

@modernpoacher/catbox-mongodb accepts the following options:

  • uri - the MongoDB URI, defaults to 'mongodb://127.0.0.1:27017/?maxPoolSize=5'
  • partition - the MongoDB database for cached items

Usage

import Catbox from '@hapi/catbox';
import Client from '@modernpoacher/catbox-mongodb'

const cache = new Catbox.Client(Client, {
  uri: 'your-mongodb-uri',
  partition: 'your-cache-partition'
})

About

A MongoDB adapter for Hapi Catbox

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.5%
  • Shell 1.5%