keyv-cosmos
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

keyv-cosmos

Cosmos DB storage adapter for Keyv

npm Codacy Badge

CosmosDB Core (SQL) storage adapter for Keyv.

TTL functionality is supported.

Typings included.

Install

npm install --save keyv keyv-cosmos

Usage

const Keyv = require("keyv");
const KeyvCosmos = require("keyv-cosmos");

const store = new KeyvCosmos(connectionString,
	{ databaseId: databaseId, containerId: containerId });

const keyv = new Keyv(connectionString, {store: store});

keyv.on("error", handleConnectionError);

Make sure your partition key is not "/id" or "/value"! Also, set TTL to "On (no default)" to enable TTL.

Package Sidebar

Install

npm i keyv-cosmos

Weekly Downloads

6

Version

1.1.0

License

MIT

Unpacked Size

10.2 kB

Total Files

7

Last publish

Collaborators

  • coffeecode