HRANDFIELD
Syntax
HRANDFIELD key [count [WITHVALUES]]
Module
hashCategories
hash read slowDescription
Returns one or more random fields from the hash.
Options
WITHVALUES
- When provided, the return value will contain the field and its value. Otherwise, only the field is returned.
Examples
- Go (Embedded)
- CLI
Returns one or more random fields from the hash:
vault, err := echovault.NewEchoVault()
if err != nil {
log.Fatal(err)
}
fields, err := vault.HRandField("key", echovault.HRandFieldOptions{})
Returns one or more random fields from the hash:
> HRANDFIELD key