map:keys

Returns a sequence containing all the keys present in a map

Signature

map:keys($map as map(*)) as xs:anyAtomicType*

Properties

This function is nondeterministic-wrt-ordering, context-independent, and focus-independent.

Rules

The function map:keys takes any map as its $map argument and returns the keys that are present in the map as a sequence of atomic values, in implementation-dependent order.

The function is non-deterministic with respect to ordering (see Properties of functions). This means that two calls with the same argument are not guaranteed to produce the results in the same order.

Notes

The number of items in the result will be the same as the number of entries in the map, and the result sequence will contain no duplicate values.

Examples

The expression map:keys(map{1:"yes", 2:"no"}) returns some permutation of (1,2). (The result is in implementation-dependent order.)