refactor: use dbname for building the collection
refactor: use dbname for building the collection

casting to string resolves a TS issue with undefined not being allowed as a string type

UnwrittenFun/rethinkts