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
__namedParameters
Section titled “__namedParameters”MongoDBDocumentStoreConfig
MongoDocumentStore
KVDocumentStore.constructor
fromMongoClient()
Section titled “fromMongoClient()”
staticfromMongoClient(mongoClient,dbName,collectionName):MongoDocumentStore
定义于:.build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:30
使用 MongoClient 创建实例的静态方法。
mongoClient
Section titled “mongoClient”MongoClient
MongoClient 实例
dbName
Section titled “dbName”string = DEFAULT_DATABASE
数据库名称
collectionName
Section titled “collectionName”string = DEFAULT_COLLECTION
集合名称
MongoDocumentStore
MongoDBDocumentStore 的实例
const mongoClient = new MongoClient("mongodb://localhost:27017");const documentStore = MongoDBDocumentStore.fromMongoClient(mongoClient, "my_db", "my_collection");fromConnectionString()
Section titled “fromConnectionString()”
staticfromConnectionString(connectionString,dbName,collectionName):MongoDocumentStore
定义于:.build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:57
用于通过连接字符串创建实例的静态方法。
connectionString
Section titled “connectionString”string
MongoDB 连接字符串
dbName
Section titled “dbName”string = DEFAULT_DATABASE
数据库名称
collectionName
Section titled “collectionName”string = DEFAULT_COLLECTION
集合名称
MongoDocumentStore
MongoDBDocumentStore 的实例
const documentStore = MongoDBDocumentStore.fromConnectionString("mongodb://localhost:27017", "my_db", "my_collection");