diff --git a/site/content/3.12/aql/functions/array.md b/site/content/3.12/aql/functions/array.md index d21b39f201..bccdd70d36 100644 --- a/site/content/3.12/aql/functions/array.md +++ b/site/content/3.12/aql/functions/array.md @@ -65,11 +65,11 @@ RETURN APPEND([ 1, 2, 3 ], [ 3, 4, 5, 2, 9 ], true) ## CONTAINS_ARRAY() -This is an alias for [POSITION()](#position). +This is an alias for [`POSITION()`](#position). ## COUNT() -This is an alias for [LENGTH()](#length). +This is an alias for [`LENGTH()`](#length). ## COUNT_DISTINCT() @@ -100,7 +100,7 @@ RETURN COUNT_DISTINCT([ "yes", "no", "yes", "sauron", "no", "yes" ]) ## COUNT_UNIQUE() -This is an alias for [COUNT_DISTINCT()](#count_distinct). +This is an alias for [`COUNT_DISTINCT()`](#count_distinct). ## FIRST() diff --git a/site/content/3.12/aql/functions/document-object.md b/site/content/3.12/aql/functions/document-object.md index dc7e995b74..8f92b6e358 100644 --- a/site/content/3.12/aql/functions/document-object.md +++ b/site/content/3.12/aql/functions/document-object.md @@ -75,7 +75,7 @@ FOR attributeArray IN attributesPerDocument ## COUNT() -This is an alias for [LENGTH()](#length). +This is an alias for [`LENGTH()`](#length). ## HAS() diff --git a/site/content/3.12/aql/functions/miscellaneous.md b/site/content/3.12/aql/functions/miscellaneous.md index 2dbf3dae51..c837531136 100644 --- a/site/content/3.12/aql/functions/miscellaneous.md +++ b/site/content/3.12/aql/functions/miscellaneous.md @@ -139,7 +139,7 @@ Return an array of collections. ### COUNT() -This is an alias for [LENGTH()](#length). +This is an alias for [`LENGTH()`](#length). ### CURRENT_DATABASE() diff --git a/site/content/3.12/aql/functions/numeric.md b/site/content/3.12/aql/functions/numeric.md index 80e021931a..a2ba67ca3a 100644 --- a/site/content/3.12/aql/functions/numeric.md +++ b/site/content/3.12/aql/functions/numeric.md @@ -101,7 +101,7 @@ AVERAGE( [ 999, 80, 4, 4, 4, 3, 3, 3 ] ) // 137.5 ## AVG() -This is an alias for [AVERAGE()](#average). +This is an alias for [`AVERAGE()`](#average). ## CEIL() @@ -577,6 +577,10 @@ Result: ] ``` +## RANDOM() + +This is an alias for [`RAND()`](#rand). + ## RANGE() `RANGE(start, stop, step) → numArray` @@ -704,7 +708,7 @@ STDDEV_SAMPLE( [ 1, 3, 6, 5, 2 ] ) // 2.0736441353327724 ## STDDEV() -This is an alias for [STDDEV_POPULATION()](#stddev_population). +This is an alias for [`STDDEV_POPULATION()`](#stddev_population). ## SUM() @@ -769,4 +773,4 @@ VARIANCE_SAMPLE( [ 1, 3, 6, 5, 2 ] ) // 4.300000000000001 ## VARIANCE() -This is an alias for [VARIANCE_POPULATION()](#variance_population). +This is an alias for [`VARIANCE_POPULATION()`](#variance_population). diff --git a/site/content/3.12/aql/functions/string.md b/site/content/3.12/aql/functions/string.md index 638147f0e7..cea60984f0 100644 --- a/site/content/3.12/aql/functions/string.md +++ b/site/content/3.12/aql/functions/string.md @@ -281,7 +281,7 @@ RETURN CONTAINS("foobarbaz", "horse", true) ## COUNT() -This is an alias for [LENGTH()](#length). +This is an alias for [`LENGTH()`](#length). ## CRC32() @@ -1233,6 +1233,45 @@ description: '' RETURN REGEX_REPLACE("An Avocado", "a", "_", true) ``` +## REPEAT() + +`REPEAT(value, count, separator) → repeatedString` + +Repeat the input as many times as specified, optionally with a separator. + +- **value** (string): a string +- **count** (number): how often to repeat the `value` +- **separator** (string, *optional*): a string to place between repetitions +- returns **repeatedString** (string\|null): a new string with the `value` + repeated `count` times, or `null` and a warning if the output string exceeds + the limit of 16 MB + +**Examples** + +```aql +--- +name: aqlRepeat_1 +description: '' +--- +RETURN REPEAT("foo", 3) +``` + +```aql +--- +name: aqlRepeat_2 +description: '' +--- +RETURN REPEAT("foo", 3, " | ") +``` + +```aql +--- +name: aqlRepeat_3 +description: '' +--- +RETURN REPEAT(5, 5) +``` + ## REVERSE() `REVERSE(value) → reversedString` @@ -1892,6 +1931,28 @@ RETURN [ ] ``` +## TO_CHAR() + +`TO_CHAR(codepoint) → character` + +Return the character with the specified codepoint. + +- **codepoint** (number): a Unicode codepoint +- returns **character** (string): the character with the specified codepoint + +**Examples** + +```aql +--- +name: aqlToChar +description: '' +--- +RETURN [ + TO_CHAR(216), + TO_CHAR(0x1F951) +] +``` + ## TO_HEX() `TO_HEX(value) → hexString` diff --git a/site/content/3.12/aql/functions/type-check-and-cast.md b/site/content/3.12/aql/functions/type-check-and-cast.md index 8789a0ee5e..84e9ced5a5 100644 --- a/site/content/3.12/aql/functions/type-check-and-cast.md +++ b/site/content/3.12/aql/functions/type-check-and-cast.md @@ -140,7 +140,7 @@ TO_ARRAY({foo: 1, bar: 2, baz: [3, 4, 5]}) // [1, 2, [3, 4, 5]] `TO_LIST(value) → array` -This is an alias for [TO_ARRAY()](#to_array). +This is an alias for [`TO_ARRAY()`](#to_array). ## Type check functions @@ -205,7 +205,7 @@ Check whether *value* is an array / list `IS_LIST(value) → bool` -This is an alias for [IS_ARRAY()](#is_array) +This is an alias for [`IS_ARRAY()`](#is_array) ### IS_OBJECT() @@ -221,7 +221,7 @@ Check whether *value* is an object / document `IS_DOCUMENT(value) → bool` -This is an alias for [IS_OBJECT()](#is_object) +This is an alias for [`IS_OBJECT()`](#is_object) ### IS_DATESTRING() diff --git a/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md b/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md index cb77fd0e4a..07ae0fa20e 100644 --- a/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md +++ b/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md @@ -183,6 +183,15 @@ less overhead. See [Document and object functions in AQL](../../aql/functions/document-object.md#parse_collection). +The new `REPEAT()` function repeats the input value a given number of times, +optionally with a separator between repetitions, and returns the resulting string. +The new `TO_CHAR()` functions lets you specify a numeric Unicode codepoint and +returns the corresponding character as a string. + +See [String functions in AQL](../../aql/functions/string.md#repeat). + +A numeric function `RANDOM()` has been added as an alias for the existing `RAND()`. + ## Indexing ### Stored values can contain the `_id` attribute diff --git a/site/data/3.12/cache.json b/site/data/3.12/cache.json index a1ab2bd84c..66b9637738 100644 --- a/site/data/3.12/cache.json +++ b/site/data/3.12/cache.json @@ -2575,6 +2575,18 @@ "request": "LS0tCm5hbWU6IGFxbFJlZ2V4VGVzdF8zCmRlc2NyaXB0aW9uOiAnJwotLS0KUkVUVVJOIFJFR0VYX1RFU1QoInRoZVxcbnF1aWNrXFxuYnJvd25cXG5mb3giLCAiXnRoZShcXG5bYS13XSspK1xcbmZveCQiKQ==", "response": "eyJpbnB1dCI6IlJFVFVSTiBSRUdFWF9URVNUKFwidGhlXFxcXG5xdWlja1xcXFxuYnJvd25cXFxcbmZveFwiLCBcIl50aGUoXFxcXG5bYS13XSspK1xcXFxuZm94JFwiKSIsIm91dHB1dCI6IltvYmplY3QgQXJhbmdvUXVlcnlDdXJzb3IsIGNvdW50OiAxLCBjYWNoZWQ6IGZhbHNlLCBoYXNNb3JlOiBmYWxzZV1cblxuWyBcbiAgdHJ1ZSBcbl0iLCJlcnJvciI6IiIsIm9wdGlvbnMiOnsiZGVzY3JpcHRpb24iOiIiLCJuYW1lIjoiYXFsUmVnZXhUZXN0XzMiLCJ0eXBlIjoic2luZ2xlIiwicmVuZGVyIjoiaW5wdXQvb3V0cHV0In19Cg==" }, + "aqlRepeat_1_single": { + "request": "LS0tCm5hbWU6IGFxbFJlcGVhdF8xCmRlc2NyaXB0aW9uOiAnJwotLS0KUkVUVVJOIFJFUEVBVCgiZm9vIiwgMyk=", + "response": "eyJpbnB1dCI6IlJFVFVSTiBSRVBFQVQoXCJmb29cIiwgMykiLCJvdXRwdXQiOiJbIFxuICBcImZvb2Zvb2Zvb1wiIFxuXSIsImVycm9yIjoiIiwib3B0aW9ucyI6eyJkZXNjcmlwdGlvbiI6IiIsIm5hbWUiOiJhcWxSZXBlYXRfMSIsInR5cGUiOiJzaW5nbGUiLCJyZW5kZXIiOiJpbnB1dC9vdXRwdXQifX0K" + }, + "aqlRepeat_2_single": { + "request": "LS0tCm5hbWU6IGFxbFJlcGVhdF8yCmRlc2NyaXB0aW9uOiAnJwotLS0KUkVUVVJOIFJFUEVBVCgiZm9vIiwgMywgIiB8ICIp", + "response": "eyJpbnB1dCI6IlJFVFVSTiBSRVBFQVQoXCJmb29cIiwgMywgXCIgfCBcIikiLCJvdXRwdXQiOiJbIFxuICBcImZvbyB8IGZvbyB8IGZvb1wiIFxuXSIsImVycm9yIjoiIiwib3B0aW9ucyI6eyJkZXNjcmlwdGlvbiI6IiIsIm5hbWUiOiJhcWxSZXBlYXRfMiIsInR5cGUiOiJzaW5nbGUiLCJyZW5kZXIiOiJpbnB1dC9vdXRwdXQifX0K" + }, + "aqlRepeat_3_single": { + "request": "LS0tCm5hbWU6IGFxbFJlcGVhdF8zCmRlc2NyaXB0aW9uOiAnJwotLS0KUkVUVVJOIFJFUEVBVCg1LCA1KQ==", + "response": "eyJpbnB1dCI6IlJFVFVSTiBSRVBFQVQoNSwgNSkiLCJvdXRwdXQiOiJbIFxuICBcIjU1NTU1XCIgXG5dIiwiZXJyb3IiOiIiLCJvcHRpb25zIjp7ImRlc2NyaXB0aW9uIjoiIiwibmFtZSI6ImFxbFJlcGVhdF8zIiwidHlwZSI6InNpbmdsZSIsInJlbmRlciI6ImlucHV0L291dHB1dCJ9fQo=" + }, "aqlReverse_1_single": { "request": "LS0tCm5hbWU6IGFxbFJldmVyc2VfMQpkZXNjcmlwdGlvbjogJycKLS0tClJFVFVSTiBSRVZFUlNFKCJmb29iYXIiKQ==", "response": "eyJpbnB1dCI6IlJFVFVSTiBSRVZFUlNFKFwiZm9vYmFyXCIpIiwib3V0cHV0IjoiW29iamVjdCBBcmFuZ29RdWVyeUN1cnNvciwgY291bnQ6IDEsIGNhY2hlZDogZmFsc2UsIGhhc01vcmU6IGZhbHNlXVxuXG5bIFxuICBcInJhYm9vZlwiIFxuXSIsImVycm9yIjoiIiwib3B0aW9ucyI6eyJkZXNjcmlwdGlvbiI6IiIsIm5hbWUiOiJhcWxSZXZlcnNlXzEiLCJ0e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Qo=" + }, "aqlToHex_single": { "request": "LS0tCm5hbWU6IGFxbFRvSGV4CmRlc2NyaXB0aW9uOiAnJwotLS0KUkVUVVJOIFsKICBUT19IRVgoIkFCQy4iKSwKICBUT19IRVgoIsO8IikKXQ==", "response": "eyJpbnB1dCI6IlJFVFVSTiBbXG4gIFRPX0hFWChcIkFCQy5cIiksXG4gIFRPX0hFWChcIsO8XCIpXG5dIiwib3V0cHV0IjoiW29iamVjdCBBcmFuZ29RdWVyeUN1cnNvciwgY291bnQ6IDEsIGNhY2hlZDogZmFsc2UsIGhhc01vcmU6IGZhbHNlXVxuXG5bIFxuICBbIFxuICAgIFwiNDE0MjQzMmVcIiwgXG4gICAgXCJjM2JjXCIgXG4gIF0gXG5dIiwiZXJyb3IiOiIiLCJvcHRpb25zIjp7ImRlc2NyaXB0aW9uIjoiIiwibmFtZSI6ImFxbFRvSGV4IiwidHlwZSI6InNpbmdsZSIsInJlbmRlciI6ImlucHV0L291dHB1dCJ9fQo="