---
title: "FAQ: What is a Collection"
description: "A collection* in RavenDB is a set of documents tagged with the same @collection metadata property."
url: "https://docs.ravendb.net/6.2/client-api/faq/what-is-a-collection"
version: "6.2"
---

# FAQ: What is a Collection

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## FAQ: What is a Collection

> **Note**
>
> - **A collection** in RavenDB is a set of documents tagged with the same `@collection` metadata property.  
>   Every document belongs to exactly one collection.
>
> - Being a schemaless database, there is no requirement that documents in the same collection will share the same structure,  
>   although typically, a collection holds similarly structured documents based on the entity type of the document.
>
> - The collection is just a virtual concept.  
>   There is no influence on how or where documents within the same collection are physically stored.
>
> - Collections are used throughout many RavenDB features, such as defining indexes, setting revisions, and much more.
>
> - In this page:
>   - [Collection Name Generation](#collection-name-generation)
>   - [Collection Usages](#collection-usages)
>
> - For more information see [Documents and Collections](https://docs.ravendb.net/6.2/studio/database/documents/documents-and-collections.md)

![Figure 1. What is a Collection](https://docs.ravendb.net/assets/images/what-is-a-collection-e379beb3a1c3afa56acc0f9c203df90b.png)

## Collection Name Generation

**When storing an entity from the client:**

- The document collection metadata is generated **based on the stored entity object type**.

- By default, the client pluralizes the collection name based on the type name.  
  e.g. storing an entity of type `Order` will generate the collection name `Orders`.

- The function that is responsible for tagging the documents can be overridden.  
  See: [Global Identifier Generation Conventions](https://docs.ravendb.net/6.2/client-api/configuration/identifier-generation/global.md#findtypetagname-and-finddynamictagname).

---

**When creating a new document through the Studio:**

- The collection metadata is generated **based on the document ID prefix**.  
  e.g  Documents that are created with the following IDs: `users|23` / `users/45` / `users/17`  
  will all belong to the same `Users` collection.

- For more information see [Documents and Collections](https://docs.ravendb.net/6.2/studio/database/documents/documents-and-collections.md)

## Collection Usages

- **A Collection Query**
  - RavenDB keeps an internal storage index per collection created.  
    This internal index is used to query the database and retrieve only documents from a specified collection.

- **In Indexing**
  - Each [Map Index](https://docs.ravendb.net/6.2/indexes/map-indexes.md) is built against a single collection (or muliple collections when using a [Multi-Map Index](https://docs.ravendb.net/6.2/indexes/multi-map-indexes.md).  
    During the indexing process, the index function iterates only over the documents that belong to the specified collection(s).

- **In Revisions**
  - Documents [Revisions](https://docs.ravendb.net/6.2/document-extensions/revisions/overview.md) can be defined per collection.

- **In Ongoing Tasks**
  - A [RavenDB ETL Task](https://docs.ravendb.net/6.2/server/ongoing-tasks/etl/raven.md) & [SQL ETL Task](https://docs.ravendb.net/6.2/server/ongoing-tasks/etl/sql.md) are defined on specified collections.

- **The @hilo Collection**
  - The ranges of available IDs values returned by [HiLo algorithm](https://docs.ravendb.net/6.2/client-api/document-identifiers/hilo-algorithm.md) are per collection name.  
    Learn more in: [The @hilo Collection](https://docs.ravendb.net/6.2/studio/database/documents/documents-and-collections.md#the-@hilo-collection)

- **The @empty Collection**
  - Learn more in: [The @empty Collection](https://docs.ravendb.net/6.2/studio/database/documents/documents-and-collections.md#the-@empty-collection)

---
