Partager via


AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord>.GetAsync Method

Definition

Overloads

GetAsync(AzureCosmosDBNoSQLCompositeKey, GetRecordOptions, CancellationToken)

Gets a record from the vector store. Does not guarantee that the collection exists. Returns null if the record is not found.

GetAsync(String, GetRecordOptions, CancellationToken)

Gets a record from the vector store. Does not guarantee that the collection exists. Returns null if the record is not found.

GetAsync(AzureCosmosDBNoSQLCompositeKey, GetRecordOptions, CancellationToken)

Gets a record from the vector store. Does not guarantee that the collection exists. Returns null if the record is not found.

public System.Threading.Tasks.Task<TRecord?> GetAsync (Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL.AzureCosmosDBNoSQLCompositeKey key, Microsoft.SemanticKernel.Data.GetRecordOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAsync : Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL.AzureCosmosDBNoSQLCompositeKey * Microsoft.SemanticKernel.Data.GetRecordOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Record (requires 'Record : null)>
override this.GetAsync : Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL.AzureCosmosDBNoSQLCompositeKey * Microsoft.SemanticKernel.Data.GetRecordOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Record (requires 'Record : null)>
Public Function GetAsync (key As AzureCosmosDBNoSQLCompositeKey, Optional options As GetRecordOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TRecord)

Parameters

key
AzureCosmosDBNoSQLCompositeKey

The unique id associated with the record to get.

options
GetRecordOptions

Optional options for retrieving the record.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

Task<TRecord>

The record if found, otherwise null.

Implements

Applies to

GetAsync(String, GetRecordOptions, CancellationToken)

Gets a record from the vector store. Does not guarantee that the collection exists. Returns null if the record is not found.

public System.Threading.Tasks.Task<TRecord?> GetAsync (string key, Microsoft.SemanticKernel.Data.GetRecordOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAsync : string * Microsoft.SemanticKernel.Data.GetRecordOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Record (requires 'Record : null)>
override this.GetAsync : string * Microsoft.SemanticKernel.Data.GetRecordOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Record (requires 'Record : null)>
Public Function GetAsync (key As String, Optional options As GetRecordOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TRecord)

Parameters

key
String

The unique id associated with the record to get.

options
GetRecordOptions

Optional options for retrieving the record.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

Task<TRecord>

The record if found, otherwise null.

Implements

Applies to