Skip to content

Commit 5a43178

Browse files
authored
Merge pull request #95 from djsauble/patch-8
Update DeleteMany.java
2 parents 1b92bd4 + ea14147 commit 5a43178

File tree

1 file changed

+9
-14
lines changed
  • astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation

1 file changed

+9
-14
lines changed

astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation/DeleteMany.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66
import io.stargate.sdk.json.domain.DeleteQuery;
77

88
public class DeleteMany {
9-
public static void main(String[] args) {
9+
public static void main(String[] args) {
10+
AstraDB db = new AstraDB("<token>", "<api_endpoint>");
11+
AstraDBCollection collection = db.createCollection("collection_vector1", 14);
1012

11-
// Given an active db and a collection with a vector field (see CreateCollection.java)
12-
AstraDB db = new AstraDB("<token>", "<api_endpoint>");
13-
14-
// Create collection if not exists
15-
AstraDBCollection collection = db
16-
.createCollection("collection_vector1",14);
17-
18-
// Delete item based on a query
19-
int deletedCount = collection
20-
.deleteMany(DeleteQuery.builder()
21-
.where("product_price").isEqualsTo(9.99)
22-
.build());
23-
}
13+
// Delete items from an existing collection with a query
14+
int deletedCount = collection
15+
.deleteMany(DeleteQuery.builder()
16+
.where("product_price").isEqualsTo(9.99)
17+
.build());
18+
}
2419
}

0 commit comments

Comments
 (0)