createMongoStorage
function createMongoStorage(options): MongoKvStorage;Defined in: src/storage/mongodb.ts:214
Create a MongoDB-backed MongoKvStorage. Connection is lazy and shared.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
MongoStorageOptions |
Returns
Section titled “Returns”Example
Section titled “Example”import { createMongoStorage } from "@xtandard/kit/storage/mongodb";
const storage = createMongoStorage({ url: process.env.MONGO_URL, dbName: "app", collectionName: "kv" });