Collections_
Organize documents with Appwrite DocumentsDB collections. Learn how to create collections, configure permissions, and add indexes for fast queries.
2 min read
Appwrite uses collections as containers of documents. Collections are schemaless, so documents in the same collection can hold different fields. You shape data in your application instead of defining columns up front.
Create collection
You can create collections using the Appwrite Console, a Server SDK, or using the CLI.
Permissions
Appwrite uses permissions to control data access. For security, only users that are granted permissions can access a resource.
By default, Appwrite doesn't grant permissions to any users when a new collection is created. This means users can't create documents or read, update, and delete existing documents until you grant access.
Set documentSecurity to true on a collection to configure permissions on individual documents. A user then needs either collection level or document level permissions to access a document.
Learn about configuring permissions.
Indexes
Databases use indexes to quickly locate data without scanning every document. To ensure the best performance, Appwrite recommends an index for every field you query. If you plan to query multiple fields in a single query, creating an index with all queried fields will yield optimal performance.
The following indexes are currently supported:
| Type | Description |
|---|---|
key | Plain index to allow queries. |
unique | Unique index to disallow duplicates. |
fulltext | For searching within text fields. Required for the search query method. |
You can create an index by navigating to your collection's Indexes tab or by using your favorite Server SDK.
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.