Share via


MongoDBServiceCollectionExtensions.AddMongoDBVectorStoreRecordCollection Method

Definition

Overloads

AddMongoDBVectorStoreRecordCollection<TRecord>(IServiceCollection, String, MongoDBVectorStoreRecordCollectionOptions<TRecord>, String)

Register a MongoDB Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2 and Microsoft.Extensions.VectorData.IVectorizedSearch`1 with the specified service ID and where the MongoDB MongoDB.Driver.IMongoDatabase is retrieved from the dependency injection container.

AddMongoDBVectorStoreRecordCollection<TRecord>(IServiceCollection, String, String, String, MongoDBVectorStoreRecordCollectionOptions<TRecord>, String)

Register a MongoDB Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2 and Microsoft.Extensions.VectorData.IVectorizedSearch`1 with the specified service ID and where the MongoDB MongoDB.Driver.IMongoDatabase is constructed using the provided connectionString and databaseName.

AddMongoDBVectorStoreRecordCollection<TRecord>(IServiceCollection, String, MongoDBVectorStoreRecordCollectionOptions<TRecord>, String)

Register a MongoDB Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2 and Microsoft.Extensions.VectorData.IVectorizedSearch`1 with the specified service ID and where the MongoDB MongoDB.Driver.IMongoDatabase is retrieved from the dependency injection container.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddMongoDBVectorStoreRecordCollection<TRecord>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string collectionName, Microsoft.SemanticKernel.Connectors.MongoDB.MongoDBVectorStoreRecordCollectionOptions<TRecord>? options = default, string? serviceId = default);
static member AddMongoDBVectorStoreRecordCollection : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Microsoft.SemanticKernel.Connectors.MongoDB.MongoDBVectorStoreRecordCollectionOptions<'Record> * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddMongoDBVectorStoreRecordCollection(Of TRecord) (services As IServiceCollection, collectionName As String, Optional options As MongoDBVectorStoreRecordCollectionOptions(Of TRecord) = Nothing, Optional serviceId As String = Nothing) As IServiceCollection

Type Parameters

TRecord

The type of the record.

Parameters

services
IServiceCollection

The IServiceCollection to register the Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2 on.

collectionName
String

The name of the collection.

options
MongoDBVectorStoreRecordCollectionOptions<TRecord>

Optional options to further configure the Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.

serviceId
String

An optional service id to use as the service key.

Returns

Service collection.

Applies to

AddMongoDBVectorStoreRecordCollection<TRecord>(IServiceCollection, String, String, String, MongoDBVectorStoreRecordCollectionOptions<TRecord>, String)

Register a MongoDB Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2 and Microsoft.Extensions.VectorData.IVectorizedSearch`1 with the specified service ID and where the MongoDB MongoDB.Driver.IMongoDatabase is constructed using the provided connectionString and databaseName.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddMongoDBVectorStoreRecordCollection<TRecord>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string collectionName, string connectionString, string databaseName, Microsoft.SemanticKernel.Connectors.MongoDB.MongoDBVectorStoreRecordCollectionOptions<TRecord>? options = default, string? serviceId = default);
static member AddMongoDBVectorStoreRecordCollection : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * string * Microsoft.SemanticKernel.Connectors.MongoDB.MongoDBVectorStoreRecordCollectionOptions<'Record> * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddMongoDBVectorStoreRecordCollection(Of TRecord) (services As IServiceCollection, collectionName As String, connectionString As String, databaseName As String, Optional options As MongoDBVectorStoreRecordCollectionOptions(Of TRecord) = Nothing, Optional serviceId As String = Nothing) As IServiceCollection

Type Parameters

TRecord

The type of the record.

Parameters

services
IServiceCollection

The IServiceCollection to register the Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2 on.

collectionName
String

The name of the collection.

connectionString
String

Connection string required to connect to MongoDB.

databaseName
String

Database name for MongoDB.

options
MongoDBVectorStoreRecordCollectionOptions<TRecord>

Optional options to further configure the Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.

serviceId
String

An optional service id to use as the service key.

Returns

Service collection.

Applies to