Skip to content

@xtandard/flags/storage/mongodb

MongoDB storage: createMongoStorage, one collection of { _id, value } documents. Optional peer dependency: mongodb.

Subpath entry for @xtandard/flags/storage/mongodb: re-exports the adapter so the bundler can map it to its own dist file.

import { … } from "@xtandard/flags/storage/mongodb";
Name Summary
createMongoStorage Create a MongoDB-backed MongoFlagsStorage. Connection is lazy: the client is created/connected on the first storage operation and reused thereafter.
Name Summary
MongoFlagsStorage A compare-and-swap capable FlagsStorage backed by MongoDB, plus a close() method that disconnects the client — but only the one this adapter created. A client you passed in is left for you to manage.
MongoStorageOptions Options for createMongoStorage. dbName defaults to "xtandard_flags", collectionName to "flags_kv".