Skip to main content
Cette page fait partie d’une compétence d’agent de code IA et est écrite pour les agents, pas pour les humains. Pour la documentation Base44 lisible par un humain, consultez la documentation développeur.

Module Entities

CRUD operations on data models. Access via base44.entities.EntityName.method().

Contents

Methods

Note: The maximum limit for list() and filter() is 5,000 items per request.

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

Event structure:

User Entity

Every app has a built-in User entity with special rules:
  • Regular users can only read/update their own record
  • Cannot create users via entities.create() - use auth.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.
  1. Authentication level: anonymous, authenticated, or service role
  2. RLS rules: Control which records (rows) users can create/read/update/delete
  3. FLS rules: Control which fields users can read/write within accessible records
Operations succeed or fail based on these rules - no partial results. RLS and FLS are configured in entity schema files (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 of EntityTypeRegistry from your project. For how to run it, use the base44-cli skill.

EntityHandler

EntitiesModule

Cette page a été traduite à l’aide de l’IA. Pour les informations les plus précises et à jour, consultez la version anglaise.