MongoDocumentStore
Defined in: .build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:13
Extends
Section titled “Extends”KVDocumentStore
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MongoDocumentStore(
__namedParameters
):MongoDocumentStore
Defined in: .build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:14
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”MongoDBDocumentStoreConfig
Returns
Section titled “Returns”MongoDocumentStore
Overrides
Section titled “Overrides”KVDocumentStore.constructor
Methods
Section titled “Methods”fromMongoClient()
Section titled “fromMongoClient()”
static
fromMongoClient(mongoClient
,dbName
,collectionName
):MongoDocumentStore
Defined in: .build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:30
Static method for creating an instance using a MongoClient.
Parameters
Section titled “Parameters”mongoClient
Section titled “mongoClient”MongoClient
MongoClient instance
dbName
Section titled “dbName”string
= DEFAULT_DATABASE
Database name
collectionName
Section titled “collectionName”string
= DEFAULT_COLLECTION
Collection name
Returns
Section titled “Returns”MongoDocumentStore
Instance of MongoDBDocumentStore
Example
Section titled “Example”const mongoClient = new MongoClient("mongodb://localhost:27017");const documentStore = MongoDBDocumentStore.fromMongoClient(mongoClient, "my_db", "my_collection");
fromConnectionString()
Section titled “fromConnectionString()”
static
fromConnectionString(connectionString
,dbName
,collectionName
):MongoDocumentStore
Defined in: .build/typescript/packages/providers/storage/mongodb/src/docStore/MongoDBDocumentStore.ts:57
Static method for creating an instance using a connection string.
Parameters
Section titled “Parameters”connectionString
Section titled “connectionString”string
MongoDB connection string
dbName
Section titled “dbName”string
= DEFAULT_DATABASE
Database name
collectionName
Section titled “collectionName”string
= DEFAULT_COLLECTION
Collection name
Returns
Section titled “Returns”MongoDocumentStore
Instance of MongoDBDocumentStore
Example
Section titled “Example”const documentStore = MongoDBDocumentStore.fromConnectionString("mongodb://localhost:27017", "my_db", "my_collection");