# Keeping Documents Small: the Subset and Computed Patterns

A product page shows its five newest reviews from a short copy kept in the product (the subset pattern), and its average rating from a count and a total that each new review adds to with $inc (the computed pattern), so the page never reads or recounts every review.

![Cheat sheet: Keeping Documents Small: the Subset and Computed Patterns](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/f595a25a4a5e4d77b637229a915b36f4.webp)

- Category: MongoDB
- Level: Journeyman
- Tags: $inc, $push and $pull, Computed Pattern, mongodb, Subset Pattern
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/mongodb-subset-and-computed-patterns-cheat-sheet
