Skip to main content
Collections are the foundation of your PocketBase database. They define the structure of your data with fields, validation rules, and access controls.

Collection types

PocketBase supports three types of collections:
  • Base - Standard collections for general data storage
  • Auth - Collections with built-in authentication (email, password, OAuth2)
  • View - Read-only collections based on SQL queries

Creating collections

Base collection

Auth collection

View collection

Field types

PocketBase supports multiple field types. Here are examples of each:

Text field

Number field

Boolean field

Email field

URL field

Date field

Select field

JSON field

File field

Relation field

Editor field

Autodate field

Access rules

Access rules use a filter syntax to control who can perform operations on collections.

Common patterns

Role-based access

Field-level access

Finding collections

Updating collections

Modify existing fields

Add new fields

Update rules

Deleting collections

Deleting a collection will permanently delete all records in that collection. This action cannot be undone.

Migration example

Here’s a complete example of creating a blog schema: