GetCollection(string, VectorStoreCollectionDefinition?)

This method creates a vector store collection using its name.

Declaration

// C#
public VectorStoreCollection<TKey, TRecord> GetCollection(string collectionName, VectorStoreCollectionDefinition? definition = null)where TKey : notnullwhere TRecord : notnull

Parameters

  • TKey

    The data type of the record key.

  • TRecord

    The record data model to use for adding, updating, and retrieving data from the collection.

  • collectionName

    The name of the collection.

  • definition

    The schema of the record type.

Return Value

A new OracleCollection<TKey, TRecord> instance for managing records in the collection.

Implements

Microsoft.Extensions.VectorData.VectorStore

Exceptions

ArgumentException:
  • The provided collectionName parameter is null, an empty string or contains white spaces only.
  • The provided collectionName is not compliant with Oracle name standard.
  • The provided TKey and TRecord cannot be mapped to an Oracle type based on the default/custom type mapping.

Remarks

To successfully request a collection, either must be annotated with attributes that define the schema of the record type, or must be provided.

The OracleCollection instance is created for application to operate on a collection. However, the collection is not created in the database. To create a collection in the database, use OracleCollection.EnsureCollectionExistsAsync().

See Also:

Microsoft.Extensions.VectorData.VectorStoreKeyAttribute, VectorStoreDataAttribute, VectorStoreVectorAttribute classes.