2.1.5 • Published 11 months ago

@keyvhq/mongo v2.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@keyvhq/mongo

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 @keyvhq/core @keyvhq/mongo

Usage

NOTE: The mongo uses url instead of uri to provide the connection string details.

const KeyvMongo = require('@keyvhq/mongo')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvMongo('mongodb://user:pass@localhost:27017/dbname')
})

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

const KeyvMongo = require('@keyvhq/mongo')
const Keyv = require('@keyvhq/core')

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

License

@keyvhq/mongo © Luke Childs, released under the MIT License. Maintained by Microlink with help from contributors.

microlink.io · GitHub microlinkhq · X @microlinkhq

2.1.5

11 months ago

2.1.1

1 year ago

2.1.0

2 years ago

2.0.0-beta.0

2 years ago

1.6.28

2 years ago

2.0.0

2 years ago

1.6.26

2 years ago

1.6.25

3 years ago

1.6.24

3 years ago

1.6.22

3 years ago

1.6.21

3 years ago

1.6.13

3 years ago

1.6.12

3 years ago

1.6.15

3 years ago

1.6.11

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.6.4

3 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.7

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago