In my node.js project I installed mysql and made this DB.js that queries the database. I'm stumped on how exactly would I query the database from the jade view.
To clarify my question, in .NET I would've returned an IQueryable from repositories and then expand the query inside the ASP.NET MVC controller, but what's the correspondent of that practice here in node? Is there even such a concept of a controller?
So how to query the database and return only what you need in the view, while also not exposing "too much" of the database in the view itself?