File tree Expand file tree Collapse file tree 1 file changed +11
-17
lines changed
astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation Expand file tree Collapse file tree 1 file changed +11
-17
lines changed Original file line number Diff line number Diff line change 66import com .fasterxml .jackson .annotation .JsonProperty ;
77
88public class ObjectMappingClearCollection {
9+ static class Product {
10+ @ JsonProperty ("product_name" ) private String name ;
11+ @ JsonProperty ("product_price" ) private Double price ;
12+ }
913
10- static class Product {
11- @ JsonProperty ("product_name" )
12- private String name ;
13- @ JsonProperty ("product_price" )
14- private Double price ;
15- }
16- public static void main (String [] args ) {
17-
18- // Accessing existing DB
19- AstraDB db = new AstraDB ("<token>" , "<api_endpoint>" );
14+ public static void main (String [] args ) {
15+ AstraDB db = new AstraDB ("<token>" , "<api_endpoint>" );
16+ AstraDBRepository <Product > collection1 =
17+ db .createCollection ("collection_simple" , Product .class );
2018
21- // Access existing collection
22- AstraDBRepository <Product > collection1 = db
23- .createCollection ("collection_simple" , Product .class );
24-
25- // Clear collection
26- collection1 .deleteAll ();
27- }
19+ // Delete all rows in a collection
20+ collection1 .deleteAll ();
21+ }
2822}
You can’t perform that action at this time.
0 commit comments