MCPcopy Create free account
hub / github.com/ExtendDB/extenddb / remove_multiple_attributes

Function remove_multiple_attributes

tests/rust/src/update_expressions.rs:174–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173#[tokio::test]
174async fn remove_multiple_attributes() {
175 let c = client();
176 let t = tables().await;
177 let table = &t.simple_key_string;
178 let mut item = create_item(table);
179 item.insert("a".into(), s("1"));
180 item.insert("b".into(), s("2"));
181 item.insert("c".into(), s("3"));
182 c.put_item()
183 .table_name(table)
184 .set_item(Some(item.clone()))
185 .send()
186 .await
187 .unwrap();
188
189 let key = get_key(table, &item);
190 c.update_item()
191 .table_name(table)
192 .set_key(Some(key.clone()))
193 .update_expression("REMOVE a, c")
194 .send()
195 .await
196 .unwrap();
197
198 let resp = c
199 .get_item()
200 .table_name(table)
201 .set_key(Some(key))
202 .consistent_read(true)
203 .send()
204 .await
205 .unwrap();
206 let got = resp.item().unwrap();
207 assert!(got.get("a").is_none());
208 assert!(got.get("b").is_some());
209 assert!(got.get("c").is_none());
210}
211
212#[tokio::test]
213async fn remove_non_existent_attribute_succeeds() {

Callers

nothing calls this directly

Calls 11

clientFunction · 0.85
tablesFunction · 0.85
create_itemFunction · 0.85
sFunction · 0.85
get_keyFunction · 0.85
insertMethod · 0.80
table_nameMethod · 0.80
put_itemMethod · 0.80
update_itemMethod · 0.80
get_itemMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected