Which language are you using? A lot of languages benefit from Collections nowadays.
But as others said, you need another level to make it nested.
class DB
{
static fetch(db, getRecord)
{
db.forEach(item => { getRecord(db); });
}
}