$character
Returns a random character.
If no arguments are set, the pool defaults to all alpha, numeric and some symbols.
Options¶
pool
(optional, primary) Character pool to construct string from. Overrides other arguments.alpha
(optional) Include alpha characters in the character pool. Defaults tofalse
.numeric
(optional) Include numeric characters in the character pool. Defaults tofalse
.symbols
(optional) Include symbols characters in the character pool. Defaults tofalse
.casing
(optional) Set the casing of the alpha characters (UPPER
orLOWER
). Default includes both cases.
Example¶
{
"charAlpha": { "$character" : { "alpha": true, "casing": "upper" } },
"charFromPool": { "$character" : "MONGO" }
}
{
"charAlpha": "Z",
"charFromPool": "M"
}