map functions

The table below lists all the map built-in functions (in this namespace: http://marklogic.com/xdmp/map).

The map built-in functions are used to create maps. Maps store name-value pairs in an in-memory data structure. You can also persist a map to disk by storing it in a document. Some programming languages implement maps using hash tables, but these map functions make it convenient for you to create and update your own maps.

Maps are represented using the map:map XQuery primitive type. When you serialize an object of map:map type, it serializes to an XML node in the http://marklogic.com/xdmp/map namespace.

12 functions
Function name Description
map:clear Clear a map.
map:contains Returns true if the key exists in the map.
map:count Returns the number of keys used in the map.
map:delete Delete a value from a map.
map:entry Constructs a new map with a single entry consisting of the key and value specified as arguments.
map:get Get a value from a map.
map:keys Get the keys used in the map.
map:map Creates a map.
map:new Constructs a new map by combining the keys from the maps given as an argument.
map:put Put a value into a map at the given key.
map:set-javascript-by-ref If true is specified, sets a map:map to be passed to JavaScript by reference.
map:with Updates a map, inserting a value into it at the given key.
Powered by MarkLogic Server | Terms of Use | Privacy Policy