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