@modernpoacher/catbox-mongodb

1.1.179 • Public • Published

@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'
})

Readme

Keywords

Package Sidebar

Install

npm i @modernpoacher/catbox-mongodb

Weekly Downloads

306

Version

1.1.179

License

BSD-3-Clause

Unpacked Size

35.6 kB

Total Files

6

Last publish

Collaborators

  • modernpoacherlimited
  • jonathanperry