File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation Expand file tree Collapse file tree 1 file changed +10
-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
12+ .createCollection ("collection_vector1" ,14 );
1013
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- }
14+ // Delete items from an existing collection with a query
15+ int deletedCount = collection
16+ .deleteMany (DeleteQuery .builder ()
17+ .where ("product_price" ).isEqualsTo (9.99 )
18+ .build ());
19+ }
2420}
You can’t perform that action at this time.
0 commit comments