This article discusses how a MongoDB Stitch Function is used to provide aggregated sensor data, such as average temperature for the last 5 minutes, in a serverless and lightweight manner, ideal for real-time applications. The function uses JavaScript (ES6) and leverages a persistent MongoDB connection, running as Goroutines with low latency. In contrast to AWS Lambda functions, which are more heavy-weight and better suited for compute-heavy operations. The Stitch Function is designed to be easy to write and deploy, allowing developers to focus on the logic of their application rather than the underlying infrastructure. It can also be called from frontend code, making it a convenient solution for real-time data processing and aggregation.