Skip to content

Commit e94a621

Browse files
committed
feat: extend WeaviateDataClientAsync with new capabilities
1 parent bc821a2 commit e94a621

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/main/java/io/weaviate/client6/v1/api/collections/data/WeaviateDataClientAsync.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ public CompletableFuture<Boolean> exists(String uuid) {
4545
return this.query.byId(uuid).thenApply(Optional::isPresent);
4646
}
4747

48+
public CompletableFuture<Void> update(String uuid,
49+
Function<UpdateObjectRequest.Builder<T>, ObjectBuilder<UpdateObjectRequest<T>>> fn)
50+
throws IOException {
51+
return this.restTransport.performRequestAsync(UpdateObjectRequest.of(collectionDescriptor.name(), uuid, fn),
52+
UpdateObjectRequest.endpoint(collectionDescriptor));
53+
}
54+
55+
public CompletableFuture<Void> replace(String uuid,
56+
Function<ReplaceObjectRequest.Builder<T>, ObjectBuilder<ReplaceObjectRequest<T>>> fn)
57+
throws IOException {
58+
return this.restTransport.performRequestAsync(ReplaceObjectRequest.of(collectionDescriptor.name(), uuid, fn),
59+
ReplaceObjectRequest.endpoint(collectionDescriptor));
60+
}
61+
4862
public CompletableFuture<Void> delete(String uuid) {
4963
return this.restTransport.performRequestAsync(new DeleteObjectRequest(collectionDescriptor.name(), uuid),
5064
DeleteObjectRequest._ENDPOINT);

0 commit comments

Comments
 (0)