Collection #
A “Collection” typically refers to a grouping or container for related data items in a database or similar data storage system. It can hold various types of data, such as documents, records, or other structured data elements. In the context of the previous discussion about namespaces and data types, a collection could contain documents, each representing a specific piece of information or record.
A collection grows as a sequence of rollings — write generations, each with its own shard layout. Writes land in the newest rolling; reads and searches span them all:
graph TD
C("collection — sales") --> R0("rolling 0
rolled over — still searchable")
C --> R1("rolling 1 — active
every write lands here")
R0 --> G0["shard groups"]
R1 --> G1["shard groups
the count may differ per rolling"]
S["_search — fans out to every rolling"] -.-> R0
S -.-> R1
Collection management #
Collection APIs are used to manage individual collections and settings.
- Create a collection
- Delete a collection
- Get collection
- Get collection schema
- Update collection schema
- Get collection settings
- Update collection settings
- Get collection index
- Get collection rollings
- Roll over a collection
- Update rolling settings
- Compact a collection
- Flush a collection
- Reshard a rolling
- Salting (salt-split routing)