Skip to content

Commit

Permalink
Examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence committed Oct 26, 2022
1 parent 2c50538 commit fa56c7c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions examples/camel-case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
};

// 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?;
}

Expand Down
13 changes: 11 additions & 2 deletions examples/fluent-query-as-stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
};

// 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?;
}

Expand Down

0 comments on commit fa56c7c

Please sign in to comment.