Skip to main contentEntities are the data models for your Base44 app. Each entity is a schema that defines the structure for documents in a collection, stored in Base44’s NoSQL database. The database is MongoDB-compatible, so you can use MongoDB operators when querying through the SDK.
When you define an entity, you automatically get full CRUD operations through the entities module in the SDK.
Entities support:
- Schema flexibility: You can update your data model at any point without running migrations.
- Realtime updates: Subscribe to changes to receive updates when records are created, updated, or deleted.
- Fine-grained security: Row-level and field-level security rules control who can access which records and fields.
Define and deploy entities
Define entities as JSON files in your project’s entities directory and deploy them with entities push or deploy. By default the entities directory is base44/entities/, but you can customize the path in your project configuration.
Entity schemas
Entity schemas are JSON Schema definitions that specify the fields, types, and validation rules for your data. Learn more about entity schemas.
User schema
Every Base44 app includes a built-in User entity that stores information about your app’s users. You can extend it with additional fields to store custom user data like company, phone number, or preferences. User fields can be referenced in security rules to control data access based on user attributes. Learn more about the User schema.
Security
Control access to your data with row-level and field-level security rules. Define who can create, read, update, and delete records based on user attributes. Learn more about security rules.