跳转到内容

MongoDocumentStore

定义于:.build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:13

  • KVDocumentStore

new MongoDocumentStore(__namedParameters): MongoDocumentStore

定义于:.build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:14

MongoDBDocumentStoreConfig

MongoDocumentStore

KVDocumentStore.constructor

static fromMongoClient(mongoClient, dbName, collectionName): MongoDocumentStore

定义于:.build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:30

使用 MongoClient 创建实例的静态方法。

MongoClient

MongoClient 实例

string = DEFAULT_DATABASE

数据库名称

string = DEFAULT_COLLECTION

集合名称

MongoDocumentStore

MongoDBDocumentStore 的实例

const mongoClient = new MongoClient("mongodb://localhost:27017");
const documentStore = MongoDBDocumentStore.fromMongoClient(mongoClient, "my_db", "my_collection");

static fromConnectionString(connectionString, dbName, collectionName): MongoDocumentStore

定义于:.build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:57

用于通过连接字符串创建实例的静态方法。

string

MongoDB 连接字符串

string = DEFAULT_DATABASE

数据库名称

string = DEFAULT_COLLECTION

集合名称

MongoDocumentStore

MongoDBDocumentStore 的实例

const documentStore = MongoDBDocumentStore.fromConnectionString("mongodb://localhost:27017", "my_db", "my_collection");