RDS
NoSQL
Tools
Registre app.use antes de app.get.
app.use
app.get
Ou exponha o banco em app.locals.db e acesse via req.locals.db.
app.locals.db
req.locals.db
Como corrigir "Cannot call method 'forEach' of undefined" vindo de aggregate()
Call to undefined method MongoDB\Driver\ReadConcern::isDefault()
Tratando Documentos Ausentes em Consultas MongoDB Node.js
Corrigindo o Erro "Cannot call method 'query' of null" com Heroku Node.js e pg