Skip to content

Commit 2f0d85a

Browse files
authored
Update ObjectMappingDeleteOne.java
1 parent a830f7e commit 2f0d85a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation/ObjectMappingDeleteOne.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
import io.stargate.sdk.json.domain.odm.Document;
88

99
public 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
}

0 commit comments

Comments
 (0)