apoc.text.randomFunction
Syntax |
|
||
Description |
Generates a random |
||
Arguments |
Name |
Type |
Description |
|
|
The length of the random string. |
|
|
|
The valid characters the random string can contain. The default is: |
|
Returns |
|
||
Usage Examples
You can generate a random string to a specified length by calling apoc.text.random with a length parameter and optional string of valid characters.
The valid parameter will accept the following regex patterns, alternatively you can provide a string of letters and/or characters.
|
Description |
|
A-Z in uppercase |
|
A-Z in lowercase |
|
Numbers 0-9 inclusive |
The following call will return a random string including uppercase letters, numbers and . and $ characters.
RETURN apoc.text.random(10, "A-Z0-9.$") AS output;
| output |
|---|
"V9Y7N54LO6" |