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.

By

Updated

Cheat sheet: Keeping Documents Small: the Subset and Computed Patterns
Category
MongoDB
Level
Journeyman
Tags
$inc, $push and $pull, Computed Pattern, mongodb, Subset Pattern