Search code examples
arangodbaql

Generate a random string using ArangoDB's AQL?


Using AQL (preferably in the ArangoDB WebUI), is it possible to generate a random string or letters and numbers similar to this: 4EKH5G3AN6HH?

If not, what is another way to do it without doing it in application code?


Solution

  • https://docs.arangodb.com/3.11/aql/functions/string/#random_token

    RANDOM_TOKEN(8) // "zGl09z42"
    

    then you can apply https://docs.arangodb.com/3.11/aql/functions/string/#upper

    UPPER(RANDOM_TOKEN(8)) // "ZGL09Z42"