Entities Module
CRUD operations on data models. Access viabase44.entities.EntityName.method().
Contents
- Methods
- Examples (Create, Bulk Create, List, Filter, Get, Update, Delete, Subscribe)
- User Entity
- Service Role Access
- Permissions
Methods
Note: The maximum limit forlist() and filter() is 5,000 items per request.
| Method | Signature | Description |
|---|---|---|
create(data) | Promise<T> | Create one record |
bulkCreate(dataArray) | Promise<T[]> | Create multiple records |
list(sort?, limit?, skip?, fields?) | Promise<Pick<T, K>[]> | Get all records (paginated) |
filter(query, sort?, limit?, skip?, fields?) | Promise<Pick<T, K>[]> | Get records matching conditions |
get(id) | Promise<T> | Get single record by ID |
update(id, data) | Promise<T> | Update record (partial update) |
updateMany(query, data) | Promise<UpdateManyResult> | Update all matching records using MongoDB update operators |
bulkUpdate(dataArray) | Promise<T[]> | Update multiple records by ID, each with its own data |
delete(id) | Promise<DeleteResult> | Delete record by ID |
deleteMany(query) | Promise<DeleteManyResult> | Delete all matching records |
importEntities(file) | Promise<ImportResult<T>> | Import from CSV (frontend only) |
subscribe(callback) | () => void | Subscribe to realtime updates (returns unsubscribe function) |
Examples
Create
Bulk Create
List with Pagination
Filter
Get by ID
Update
Delete
Update Many (MongoDB-style)
Bulk Update (by ID)
Import from File
Subscribe to Realtime Updates
User Entity
Every app has a built-inUser entity with special rules:
- Regular users can only read/update their own record
- Cannot create users via
entities.create()- useauth.register()instead - Service role has full access to all user records
Service Role Access
For admin-level operations (bypass user permissions):Permissions (RLS & FLS)
Data access is controlled by Row Level Security (RLS) and Field Level Security (FLS) rules defined in entity schemas.- Authentication level: anonymous, authenticated, or service role
- RLS rules: Control which records (rows) users can create/read/update/delete
- FLS rules: Control which fields users can read/write within accessible records
base44/entities/*.jsonc). See entities-create.md for configuration details.
Note: asServiceRole sets the user’s role to "admin" but does NOT bypass RLS. Your RLS rules must include admin access (e.g., { "user_condition": { "role": "admin" } }) for service role operations to succeed.
Type Definitions
RealtimeEvent
Result Types
SortField and Server Fields
Type Registry (for typed entities)
How to get typed entities: The Base44 CLI can generate entity interfaces and an augmentation ofEntityTypeRegistry from your project. For how to run it, use the base44-cli skill.

