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

Function array_remove_function

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

Source from the content-addressed store, hash-verified

265
266#[test]
267fn array_remove_function() {
268 let expr = nodedb_query::expr_parse::parse_generated_expr("array_remove(tags, 'b')")
269 .unwrap()
270 .0;
271 let doc = nodedb_types::Value::from(serde_json::json!({"tags": ["a", "b", "c"]}));
272 assert_eq!(
273 expr.eval(&doc),
274 nodedb_types::Value::Array(vec![
275 nodedb_types::Value::String("a".into()),
276 nodedb_types::Value::String("c".into()),
277 ])
278 );
279}
280
281#[test]
282fn no_match_returns_zero() {

Callers

nothing calls this directly

Calls 1

parse_generated_exprFunction · 0.85

Tested by

no test coverage detected