{ "ns" : "http://zorba.io/modules/unordered-maps", "description" : " This module defines a set of functions for working with maps. A map\n is identified by a string and can be created using the map:create function\n and dropped using the map:drop function.\n
\n It is possible to create persistent and transient maps. The lifetime of a\n transient map is limited by the execution of the current query.\n A persistent map lives until it is explicitly dropped.\n Accordingly, it is also available to other requests.\n
\n For example,\n
map:create(\"my-map\", [\"string\", \"integer\"], { \"persistent\" : false })\n will create a transient map named my-map having two keys.\n The types of the keys are string and integer.\n
\n The key of a particular entry in the map can consist of a tuple of\n atomic values (called key attributes). The actual type of each attribute\n is determined when the map is created. The value of each entry is a\n sequence of items. If an item in this sequence is a object or array,\n this item needs to belong to a collection, otherwise, an error is raised.\n", "sees" : [ ], "authors" : [ "
\n", "summary" : "
The function returns a sequence of names of the maps that are\n available (persistent and non-persistent).
", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "string*", "description" : "A sequence of string, one for each available map, or an empty sequence." }, "errors" : [ ] }, { "arity" : 2, "name" : "create", "qname" : "map:create", "signature" : "($name as string, $key-types as item()) as empty-sequence() external", "description" : " Create a persistent map with a given name and type identifiers for the key\n attributes.\n\n If the map has only one key attribute, a single type identifier is given,\n for more than one key attribute an array of type identifiers is given.\n Calling this function is equivalent to calling create with the options\n { \"persistent\" : true }
\n Note that the function is sequential and immediately creates the map.\n
\n Each key-type should be specified as string (e.g. \"integer\",\n \"string\", \"boolean\", \"double\", or \"datetime\").\n
\n For example,\n
map:create(\"my-map\", \"string\")or\n
map:create(\"my-map\", [\"string\", \"integer\"]).\n", "summary" : "
Create a persistent map with a given name and type identifiers for the key\n attributes.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "\n If the map has only one key attribute, a single type identifier is given,\n for more than one key attribute an array of type identifiers is given.\n Currently only one option is supported: To create a transient map the object\n { \"persistent\" : false }
\n has to be passed to the $options parameter.\n Note that the function is sequential and immediately creates the map in the\n store.\n
\n Note that a map cannot be created if it already exists in a parent context.\n For example, a map that was created in an outer query cannot be\n created again in an inner query executed using the\n reflection:eval-s
function.\n", "summary" : "
Create a map with a given name, type identifiers for the key attributes, and\n options.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "\n If the map has only one key attribute, a single key value is given, for\n more than one key attribute an array of key values is given.\n
\n Note that it is possible to insert entries with empty key attributes.\n However as the removing the entries is based on the \"eq\" comparison and\n as \"eq\" with an empty sequence always return false, it is not possible\n to delete these entries.\n", "summary" : "
Removes an entry identified by the given key from the map.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "\n Note that a map can only be dropped in the context it was created.\n For example, a map that was created in an outer query cannot be\n dropped in an inner query executed using the\n reflection:eval-s
function.\n", "summary" : "
Deletes the map with the given name.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "\n If the map has only one key attribute, a single key value is given, for\n more than one key attribute an array of key values is given.\n
\n Note that it is possible to insert entries with empty key attributes.\n However as the getting the entries is based on the \"eq\" comparison and\n as \"eq\" with an empty sequence always return false, it is not possible\n to retrieve these entries.\n
\n For example,\n
map:get(\"my-map\", \"key\")or\n
map:get(\"my-map\", [ \"key1\", \"key2\" ]).\n", "summary" : "
Returns the value of the entry with the given key from the map.
", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "\n If the map has only one key attribute, a single key value is given, for\n more than one key attribute an array of key values is given.\n If an entry with the given key already exists in the map, the value\n sequences of the existing entry and the sequence passed using $value\n argument are concatenated.\n
\n If an item in the value sequence is an object or array, this\n item needs to belong to a collection, otherwise, an an error\n is raised.\n
\n Note that it is possible to insert entries with empty key attributes\n or key attributes having the value null
. However, as\n the comparison with an empty sequence or null always returns false,\n it is not possible to retrieve these entries.\n
\n For example,\n
map:insert(\"my-map\", \"key\", \"value\")or\n
map:insert(\"my-map\", [ \"key1\", \"key2\" ] , (42, \"value\")).\n", "summary" : "
Inserts a new entry into the map with the given name.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "\n The following condition always holds:\n map:size($name) eq count(map:keys($name))\n", "summary" : "
Returns the keys of all entries of a map.
", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "The function returns the options that were passed during creation or the\n default options if no options were passed.
", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "\n The following condition always holds:\n map:size($name) eq count(map:keys($name))\n", "summary" : "
Returns the number of entries in a map.
", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "name", "type" : "string", "occurence" : null, "description" : "