
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@keyv/mongo
Advanced tools
MongoDB storage adapter for Keyv
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.
npm install --save keyv @keyv/mongo
import Keyv from 'keyv';
import KeyvMongo from '@keyv/mongo';
const keyv = new Keyv(new KeyvMongo('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' });
FAQs
MongoDB storage adapter for Keyv
The npm package @keyv/mongo receives a total of 5,933 weekly downloads. As such, @keyv/mongo popularity was classified as popular.
We found that @keyv/mongo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.