简体   繁体   English

使用 ArangoDB 的 AQL 生成随机字符串?

[英]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 ?使用 AQL(最好在 ArangoDB WebUI 中),是否可以生成类似于以下内容的随机字符串或字母和数字: 4EKH5G3AN6HH

If not, what is another way to do it without doing it in application code?如果不是,那么不用在应用程序代码中执行它的另一种方法是什么?

Great answer from sevcik.tk Just in case, you can generate documents full of random data like that:来自 sevcik.tk 的好答案 以防万一,您可以生成充满随机数据的文档,如下所示:

FOR i IN 1..300000
  INSERT {
    code: CONCAT("t", i),
    name: RANDOM_TOKEN(32),
    article1: RANDOM_TOKEN(10),
    article2: RANDOM_TOKEN(20)
  } IN batchtest

And there is link to useful functions: https://www.arangodb.com/docs/stable/aql/functions-string.html#random_token还有有用功能的链接: https : //www.arangodb.com/docs/stable/aql/functions-string.html#random_token

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM