I found that kvs is a keystore, so we should only look for the entry with the keys specified in the entity table schema:
-record(user, {
id,
userName,
password
}).
#table{name=user,fields=record_info(fields,user), keys = [userName]}
Then we can do this:
kvs:index(user, userName, "Alexander").
source
share