Declaring an Embedded Object
Annotate the nested class with@embedded or @Embedded() and use it as a field type in your root collection.
Order is the root collection. Address is stored inside each order document — there is no separate addresses collection or join step.
Embedded classes are not passed to
Cindel.open as schema entries. Only root collection schemas go in the schema list. The generator registers embedded types through their parent collection automatically.Key Constraints
Embedded objects are intentionally simpler than root collections. Keep these limits in mind when modeling:No own ID
Embedded objects do not have a
dbId field. They are identified by their position inside the parent document.No independent CRUD
You cannot call
get, put, delete, or filter directly on an embedded class. All persistence goes through the parent collection.No indexes on embedded fields
Cindel does not support
@Index on fields of an embedded class. Place indexes on root collection fields when you need indexed lookup.No nested lists
A
List field inside an embedded object cannot itself contain a List. For deeper nesting, use additional embedded classes as list element types.Nullable and List Variants
Embedded fields can be nullable or collected into a list.Nullable Embedded Field
List of Embedded Objects
Nested Embedding
An embedded object can itself contain another embedded object. This lets you model structured hierarchies up to any depth, as long as no level contains a nested list.Email is the root. Recipient is stored inside each email. RecipientMetadata is stored inside each recipient.
Filtering on Embedded Fields
The generated query API provides typed helpers that navigate embedded field paths. You do not need to write raw path strings for common queries.Filter a Single Embedded Object
Filter Nested Embedded Objects
Filter a List of Embedded Objects by Element
@Name) keeps your Dart code consistent.