Faker Generator
The faker command generates data using Datafaker.
riotx faker [OPTIONS] FIELD... [REDIS COMMAND...]
where FIELD is a Faker field in the form field="expression".
To show the full usage, run:
riotx faker --help
You must specify at least one Redis command as a target.
|
Redis connection options apply to the root command ( In this example the Redis options will not be taken into account:
|
|
Use
|
Keys
Keys are constructed from input records by concatenating the keyspace prefix and key fields.
riotx faker id="numerify('##########')" firstName="name.firstName" lastName="name.lastName" address="address.fullAddress" hset person:#{id}
riotx faker name="gameOfThrones.character" --count 1000 sadd got:characters --member "#{name}"
Data Providers
Faker offers many data providers. Most providers don’t take any arguments and can be called directly:
riotx faker firstName="name.firstName"
Some providers take parameters:
riotx faker lease="number.digits(2)"
Here are a few sample Faker expressions:
-
regexify('(a|b){2,3}') -
regexify('\\.\\*\\?\\+') -
bothify('????',false) -
name.firstName -
name.lastName -
number.numberBetween(1,10)
Options
--count <int>-
Number of items to generate (default: 1000). Supports suffixes like
10kor5m. --locale <tag>-
Faker locale for localized data generation (default: system locale). Examples:
en_US,fr_FR,de_DE. --help-faker [provider…]-
Display available Faker providers and their methods. If no provider is specified, lists all available providers.
riotx faker --count 100k id="numerify('####')" name="name.fullName" hset person:#{id}
riotx faker --locale fr_FR name="name.fullName" address="address.fullAddress" hset contact:#{index}
riotx faker --help-faker
riotx faker --help-faker name address