From 521ca5a1b32a82e225e2427a0813e213cc69d572 Mon Sep 17 00:00:00 2001 From: Tomer Filiba Date: Thu, 8 Aug 2024 22:39:44 +0300 Subject: [PATCH] readme --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index dd9a8c4..44d7029 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,17 @@ for res in db.iter() { } assert_eq!(db.iter().count(), 0); + +db.set_in_collection("mycoll", "key1", "123")?; +db.set_in_collection("mycoll", "key2", "456")?; +assert_eq!(db.get_from_collection("mycoll", "key1")?, Some("123".into())); + +assert_eq!(db.iter_collections("mycoll").count(), 2); + +for res in db.iter_collections("mycoll") { + let (k, v) = res?; + println!("{k:?} => {v:?}"); +} ``` ## Design Goals