From fa56c7ce04877d759411a6b896a93d3e05d48322 Mon Sep 17 00:00:00 2001 From: Abdulla Abdurakhmanov Date: Wed, 26 Oct 2022 12:14:43 +0200 Subject: [PATCH] Examples update --- examples/camel-case.rs | 13 +++++++++++-- examples/fluent-query-as-stream.rs | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/examples/camel-case.rs b/examples/camel-case.rs index 7a4b32e..aece801 100644 --- a/examples/camel-case.rs +++ b/examples/camel-case.rs @@ -43,11 +43,20 @@ async fn main() -> Result<(), Box> { }; // Remove if it already exist - db.delete_by_id(TEST_COLLECTION_NAME, &my_struct.some_id) + db.fluent() + .delete() + .from(TEST_COLLECTION_NAME) + .document_id(&my_struct.some_id) + .execute() .await?; // Let's insert some data - db.create_obj(TEST_COLLECTION_NAME, &my_struct.some_id, &my_struct) + db.fluent() + .insert() + .into(TEST_COLLECTION_NAME) + .document_id(&my_struct.some_id) + .object(&my_struct) + .execute() .await?; } diff --git a/examples/fluent-query-as-stream.rs b/examples/fluent-query-as-stream.rs index 4f3afb6..cd141b6 100644 --- a/examples/fluent-query-as-stream.rs +++ b/examples/fluent-query-as-stream.rs @@ -42,11 +42,20 @@ async fn main() -> Result<(), Box> { }; // Remove if it already exist - db.delete_by_id(TEST_COLLECTION_NAME, &my_struct.some_id) + db.fluent() + .delete() + .from(TEST_COLLECTION_NAME) + .document_id(&my_struct.some_id) + .execute() .await?; // Let's insert some data - db.create_obj(TEST_COLLECTION_NAME, &my_struct.some_id, &my_struct) + db.fluent() + .insert() + .into(TEST_COLLECTION_NAME) + .document_id(&my_struct.some_id) + .object(&my_struct) + .execute() .await?; }