test getByKey function
db / getByKey: do not raise error if err is undefined