# Different Shapes in One Collection: the Polymorphic Pattern

Bikes, helmets and lights can share one products collection, each with the fields every product has, its own fields, and a type field that says which kind it is, so one query can search them all and another can pick out one kind.

![Cheat sheet: Different Shapes in One Collection: the Polymorphic Pattern](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/73c70add84f34a05985385a39fabd6e6.webp)

- Category: MongoDB
- Level: Journeyman
- Tags: mongodb, Polymorphic Pattern, Schema Design Patterns, Schemaless
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/mongodb-polymorphic-pattern-cheat-sheet
