Skip to content

Commit d1ca2ea

Browse files
authored
Update DeleteOne.java
* Use a two-space indent * Add space between method params * Remove comments that aren't core to the example * Reword the comment slightly
1 parent ffab770 commit d1ca2ea

File tree

1 file changed

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

1 file changed

+6
-11
lines changed

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
import io.stargate.sdk.json.domain.DeleteQuery;
66

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

10-
// Given an active db and a collection with a vector field (see CreateCollection.java)
11-
AstraDB db = new AstraDB("<token>", "<api_endpoint>");
12-
13-
// Create collection if not exists
14-
AstraDBCollection collection = db
15-
.createCollection("collection_vector1",14);
16-
17-
// Delete item based on a query
18-
int deletedCount = collection.deleteOne(DeleteQuery.deleteById("id1"));
19-
}
12+
// Delete items from an existing collection with a query
13+
int deletedCount = collection.deleteOne(DeleteQuery.deleteById("id1"));
14+
}
2015
}

0 commit comments

Comments
 (0)