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.numbeBbetween(1,10)