1.1.1 • Published 4 years ago
keyv-mongo-native v1.1.1
keyv-mongo-native
MongoDB Native storage adapter for Keyv
MongoDB Native storage adapter for Keyv. This adapter uses the native MongoDB Node.js Driver instead of any third-party library.
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-native
Usage
const Keyv = require('keyv');
const keyv = new Keyv({ store: new KeyvMongoNative('mongodb://user:pass@localhost:27017/dbname') });
keyv.on('error', handleConnectionError);
License
MIT © RatserX