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 : notnullParameters
TKeyThe data type of the record key.
TRecordThe record data model to use for adding, updating, and retrieving data from the collection.
collectionNameThe name of the collection.
definitionThe 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
collectionNameparameter is null, an empty string or contains white spaces only. - The provided
collectionNameis not compliant with Oracle name standard. - The provided
TKeyandTRecordcannot 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.