File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 55import io .stargate .sdk .json .domain .DeleteQuery ;
66
77public 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}
You can’t perform that action at this time.
0 commit comments