@John_Page, thank you very much for this thorough and well written discussion on the evolution of stored procedure and DAL. I went over and beyond what I hoped to achieve by posting on this forum. I learned a great deal, and I will reference this thread for years to come.
My takeaway: system.js javascript functions where I store aggregation pipelines are not necessarily evil, however they should be limited to small “inline” functions. The main reason for this is that code execution on the DB server doesn’t scale as well as code that runs as a micro-service. I will follow this principle: store complex aggregation pipelines in system.js when I feel like they will benefit from being encapsulated, but migrate them to a micro-service if they start using up significant database server resources.