Skip to content

@xtandard/entitlements/storage/mongodb

MongoDB state storage: one { _id: key, value } collection over the mongodb driver, with single-update compare-and-swap.

import { … } from "@xtandard/entitlements/storage/mongodb";
Name Summary
createMongoStorage Create a MongoDB-backed MongoEntitlementsStorage. The client is created and connected lazily when only a url is given.
Name Summary
MongoEntitlementsStorage A compare-and-swap capable storage backed by MongoDB, plus close().
MongoStorageOptions Options for createMongoStorage. dbName defaults to "xtandard_entitlements" and collectionName to "entitlements_kv".