Function streamdal_wasm_transform::transform::overwrite
source · pub fn overwrite(req: &Request) -> Result<String, TransformError>
Examples found in repository?
examples/usage.rs (line 34)
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
fn overwrite() {
let sample_json = r#"{"hello": "world"}"#;
let req = transform::Request {
data: sample_json.into(),
path: "hello".to_string(),
value: r#""baz""#.to_string(),
truncate_options: None,
};
let updated_json = transform::overwrite(&req).unwrap();
println!(
"Input JSON: {} || Result JSON: {}",
sample_json, updated_json,
)
}