MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / array_append_function

Function array_append_function

nodedb/tests/executor_tests/test_array_ops.rs:251–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

249
250#[test]
251fn array_append_function() {
252 let expr = nodedb_query::expr_parse::parse_generated_expr("array_append(tags, 'new')")
253 .unwrap()
254 .0;
255 let doc = nodedb_types::Value::from(serde_json::json!({"tags": ["a", "b"]}));
256 assert_eq!(
257 expr.eval(&doc),
258 nodedb_types::Value::Array(vec![
259 nodedb_types::Value::String("a".into()),
260 nodedb_types::Value::String("b".into()),
261 nodedb_types::Value::String("new".into()),
262 ])
263 );
264}
265
266#[test]
267fn array_remove_function() {

Callers

nothing calls this directly

Calls 1

parse_generated_exprFunction · 0.85

Tested by

no test coverage detected