【发布时间】:2019-04-25 18:43:43
【问题描述】:
我有以下代码返回结果数组我尝试使用 distinct-values 删除重复项,但它什么也没做我也尝试使用循环函数通过比较值来删除但没有成功。
我尝试转换为“xs anyAtomicType”并使用不同的值 我尝试放入 json 数组并提取子数组 我尝试过标记化、xdmp 引用、字符串之前/之后以及许多其他方法
declare function local:verify-user-uri($dir as xs:string)
{
for $each in cts:uris($dir, ())
let $uIds := (for $d in $each
where contains($d, "/profile.xml")
return $d)
return $uIds
};
我以以下形式返回重复的结果:
/users/123-343-/profile.xml
/users/122-222-/profile.xml
/users/123-343-/profile.xml
/users/122-222-/profile.xml
/users/123-343-/profile.xml
/users/122-222-/profile.xml
我期待:
/users/123-343-/profile.xml
/users/122-222-/profile.xml
【问题讨论】:
-
请包含重现您的问题所需的所有代码。 URI 在数据库中是唯一的,因此您包含的示例没有意义。
标签: duplicates xquery marklogic