File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 77import io .stargate .sdk .json .domain .odm .Document ;
88
99public class ObjectMappingDeleteOne {
10- static class Product {
11- @ JsonProperty ("product_name" ) private String name ;
12- @ JsonProperty ("product_price" ) private Double price ;
13- }
10+ static class Product {
11+ @ JsonProperty ("product_name" ) private String name ;
12+ @ JsonProperty ("product_price" ) private Double price ;
13+ }
1414
15- public static void main (String [] args ) {
16- AstraDB db = new AstraDB ("<token>" , "<api_endpoint>" );
17- AstraDBRepository <Product > collection1 = db
18- .createCollection ("collection_simple" , Product .class );
15+ public static void main (String [] args ) {
16+ AstraDB db = new AstraDB ("<token>" , "<api_endpoint>" );
17+ AstraDBRepository <Product > collection1 =
18+ db .createCollection ("collection_simple" , Product .class );
1919
20- // Delete document from its id
21- collection1 .deleteById ("id1" );
20+ // Delete a document by ID
21+ collection1 .deleteById ("id1" );
2222
23- // Delete provided document
24- collection1 .delete (new Document <Product >().id ("id2" ));
23+ // Delete a specific document
24+ collection1 .delete (new Document <Product >().id ("id2" ));
2525 }
2626}
You can’t perform that action at this time.
0 commit comments