This package has been deprecated

Author message:

Package has been renamed to @keyvhq/mongo

@keyvhq/keyv-mongo

1.0.0 • Public • Published

@keyv/mongo keyv

MongoDB storage adapter for Keyv

Build Status Coverage Status npm

MongoDB storage adapter for Keyv.

Uses TTL indexes to automatically remove expired documents. However MongoDB doesn't guarantee data will be deleted immediately upon expiration, so expiry dates are revalidated in Keyv.

Install

npm install --save keyv @keyv/mongo

Usage

const Keyv = require('keyv')

const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname')
keyv.on('error', handleConnectionError)

You can specify the collection name, by default 'keyv' is used.

e.g:

const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname', { collection: 'cache' })

License

keyv © Luke Childs, Released under the MIT License.
Maintained by Kiko Beats and Jytesh, with help from contributors.

Package Sidebar

Install

npm i @keyvhq/keyv-mongo

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.29 kB

Total Files

4

Last publish

Collaborators

  • jytesh
  • kikobeats