MarkLogic External Name

Viewed 14

External Name

The result number external name always returns zero. I don't know do I missing any code.

let $externalcnt := fn:count(xdmp:user-external-security(fn:data(fn:doc($user)/sec:user/sec:user-id)))
     return fn:concat('Num External Names: "', $externalcnt,'"'),

enter image description here

1 Answers

The xdmp:user-external-security() function uses the external user id to lookup the user.

You are listing all of the sec:user-id values, but should instead obtain the user-id for all of the /sec:user/sec:external-names/sec:external-name and then use that ID to obtain the external-security:

doc()/sec:user/sec:external-names/sec:external-name ! xdmp:user(.) ! xdmp:user-external-security(.)
Related