Company
Date Published
Author
Dj Walker-Morgan
Word count
1770
Language
English
Hacker News points
None

Summary

On-Demand Materialized Views` is a new feature in MongoDB 4.2 that allows developers to create collections based on an aggregation pipeline, enabling efficient updates and incremental data processing. The `$merge` stage can be used to merge the results of an aggregation into a collection, allowing for incremental updates without rebuilding the entire collection. This feature provides flexibility over the older `$out` stage, with additional options such as reading from or writing to sharded collections, and even writing to a different database. The ability to customize the process and index the materialized view in a different way can also be beneficial. Overall, this new feature enables developers to create scalable and efficient data pipelines that can handle large volumes of data and provide real-time updates.