Skip to content

Commit 27a4c6e

Browse files
committed
support update condition filter param
1 parent 885fbed commit 27a4c6e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/Qdrant.Client/QdrantClient.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ public async Task<IReadOnlyList<AliasDescription>> ListAliasesAsync(Cancellation
13451345
/// </summary>
13461346
/// <param name="collectionName">The name of the collection.</param>
13471347
/// <param name="points">The points to be upserted.</param>
1348+
/// <param name="updateFilter">Conditional update filter.</param>
13481349
/// <param name="wait">Whether to wait until the changes have been applied. Defaults to <c>true</c>.</param>
13491350
/// <param name="ordering">Write ordering guarantees.</param>
13501351
/// <param name="shardKeySelector">Option for custom sharding to specify used shard keys.</param>
@@ -1354,10 +1355,12 @@ public async Task<IReadOnlyList<AliasDescription>> ListAliasesAsync(Cancellation
13541355
public async Task<UpdateResult> UpsertAsync(
13551356
string collectionName,
13561357
IReadOnlyList<PointStruct> points,
1358+
Filter updateFilter = null,
13571359
bool wait = true,
13581360
WriteOrderingType? ordering = null,
13591361
ShardKeySelector? shardKeySelector = null,
1360-
CancellationToken cancellationToken = default)
1362+
CancellationToken cancellationToken = default,
1363+
)
13611364
{
13621365
var request = new UpsertPoints
13631366
{
@@ -1372,6 +1375,9 @@ public async Task<UpdateResult> UpsertAsync(
13721375
if (shardKeySelector is not null)
13731376
request.ShardKeySelector = shardKeySelector;
13741377

1378+
if (updateFilter is not null)
1379+
request.UpdateFilter = updateFilter;
1380+
13751381
_logger.Upsert(collectionName, points.Count);
13761382

13771383
try
@@ -1779,6 +1785,7 @@ public async Task<IReadOnlyList<RetrievedPoint>> RetrieveAsync(
17791785
/// </summary>
17801786
/// <param name="collectionName">The name of the collection.</param>
17811787
/// <param name="points">The list of points and vectors to update.</param>
1788+
/// <param name="updateFilter">Conditional update filter.</param>
17821789
/// <param name="wait">Whether to wait until the changes have been applied. Defaults to <c>true</c>.</param>
17831790
/// <param name="ordering">Write ordering guarantees.</param>
17841791
/// <param name="shardKeySelector">Option for custom sharding to specify used shard keys.</param>
@@ -1788,6 +1795,7 @@ public async Task<IReadOnlyList<RetrievedPoint>> RetrieveAsync(
17881795
public async Task<UpdateResult> UpdateVectorsAsync(
17891796
string collectionName,
17901797
IReadOnlyList<PointVectors> points,
1798+
Filter updateFilter = null,
17911799
bool wait = true,
17921800
WriteOrderingType? ordering = null,
17931801
ShardKeySelector? shardKeySelector = null,
@@ -1806,6 +1814,9 @@ public async Task<UpdateResult> UpdateVectorsAsync(
18061814
if (shardKeySelector is not null)
18071815
request.ShardKeySelector = shardKeySelector;
18081816

1817+
if (updateFilter is not null)
1818+
request.UpdateFilter = updateFilter;
1819+
18091820
_logger.UpdateVectors(collectionName);
18101821

18111822
try

0 commit comments

Comments
 (0)