and received exception "The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: local:shallow-copy($a as element()) element(). Expected cardinality: exactly one, got 1. [at line 38, column 10].
if I remove: collection("/db/pub")/
I get correct results and no exception (although query against entire db and not specific collection).
and this works. Thanks for the suggestions, Pierrick.