Skip to content

Commit

Permalink
Update src/Databases/Mongo/src/MongoVectorCollection.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV authored May 2, 2024
1 parent 0993214 commit 1a5b4ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Databases/Mongo/src/MongoVectorCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<bool> DeleteAsync(IEnumerable<string> ids, CancellationToken c

public async Task<bool> IsEmptyAsync(CancellationToken cancellationToken = default)
{
return await _mongoCollection.CountDocumentsAsync(FilterDefinition<Vector>.Empty, cancellationToken: cancellationToken).ConfigureAwait(false) == 0;
return await _mongoCollection.EstimatedDocumentCountAsync(cancellationToken: cancellationToken).ConfigureAwait(false) == 0;
}

public async Task<VectorSearchResponse> SearchAsync(VectorSearchRequest request, VectorSearchSettings? settings = null, CancellationToken cancellationToken = default)
Expand Down

0 comments on commit 1a5b4ca

Please sign in to comment.