@keyv/mongo
MongoDB storage adapter for Keyv
Last updated 2 years ago by lukechilds .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @keyv/mongo 
SYNC missed versions from official npm registry.

@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

MIT © Luke Childs

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

3 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 8
Last Day 1
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (10)

Copyright 2014 - 2016 © taobao.org |