Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mainser/cindel/llms.txt
Use this file to discover all available pages before exploring further.
CindelTypedCollection<T> is the generated typed access layer that bridges your Dart model class to a Cindel collection at runtime. Every public method accepts and returns fully typed T objects, so your application code never touches raw documents or byte buffers. In practice you never instantiate this class yourself — the code generator produces an extension getter on CindelDatabase (for example, db.users) that returns a ready-to-use CindelTypedCollection<User>. The class delegates all persistence details to CindelDatabase and selects the fastest safe path available — native binary plans on MDBX, native SQLite document reads on the SQLite backends, or Dart-side deserialization as a fallback.
Properties
The
CindelDatabase instance that owns this collection. All read and write
calls are routed through this handle, which means the collection respects any
active transaction started on the same database.Generated schema metadata for this collection, including the collection name,
field descriptors, id accessor, serializers, and link binders. This value is
produced by the code generator and should be treated as opaque by application
code.
Write Operations
put
schema.
If the object’s id field equals autoIncrement, Cindel allocates the next database id and writes it back through the generated id setter before the object is stored. After put returns, the dbId field on the object reflects the assigned id.
The object to persist. When the id field is
autoIncrement, the assigned id
is written back to this object before the method returns.putAll
objects atomically. Auto-increment ids are allocated individually for objects whose id field equals autoIncrement, and each assigned id is written back before the batch reaches storage.
Duplicate ids within the same call throw an ArgumentError before any write reaches storage. An empty iterable is treated as a no-op and returns immediately.
The objects to persist. Duplicate ids across this iterable cause an
ArgumentError. An empty iterable is a no-op.putMany
putAll. Provided for APIs that prefer many naming. Behaviour is identical in every respect.
The objects to persist. Delegates directly to
putAll.Read Operations
get
id, or null if no document with that id exists in the collection.
The document id to look up.
getAll
ids, preserving input order. Missing ids appear as null at the corresponding position in the returned list. The list length always equals the number of ids supplied.
The document ids to fetch. The result preserves this order and returns
null for each id that does not exist.Delete Operations
delete
id. If no document with that id exists, the call completes without error.
The document id to delete.
deleteAll
ids atomically. Missing ids are ignored. An empty iterable is a no-op.
The document ids to delete. Missing ids are silently ignored.
Query Builders
Query builders return aCindelQuery<T> that can be further refined with filters, sorts, and pagination before execution. All query methods are non-mutating — each call returns a new query object.
all
findAll() or count().
where
A generated method available only when the collection declares at least one @Index field. where() returns a typed where-clause builder whose methods correspond to the indexed fields — for example, emailEqualTo, createdAtBetween, or nameSortBy. Index-backed queries let Cindel use the underlying index to narrow the candidate document set before any Dart-side filtering.
filter
A generated method that returns a typed filter builder covering all persisted fields in the collection, regardless of whether they are indexed. Filter builders generate per-field predicate methods — for example, activeEqualTo, nameContains, tagsElementEqualTo — and can be chained with sorting and pagination helpers.
Unlike
where(), filter() does not restrict predicates to indexed fields,
but it also does not guarantee an index-backed execution path. For
high-cardinality lookups on large collections, prefer where() when an
appropriate index is available.Watchers
Watcher methods returnStream values that emit when the underlying collection data changes. Streams use polling internally and deduplicate consecutive identical snapshots, so listeners only fire when the observed data actually changes.
watchObject
id each time that document changes. When the document does not exist — including after it is deleted — the stream emits null.
By default the stream emits the current value immediately on subscription. Set fireImmediately: false to suppress the initial event and only receive subsequent changes.
The document id to watch.
How often the underlying change watcher polls for updates. Defaults to the
global
defaultCindelWatchPollInterval constant.When
true (the default), the stream emits the current object value
immediately on subscription before waiting for the next change. Set to
false to receive only subsequent change events.watchCollection
all().findAll().
How often the underlying change watcher polls for updates. Defaults to the
global
defaultCindelWatchPollInterval constant.When
true (the default), the stream emits the current collection snapshot
immediately on subscription before waiting for the next change. Set to
false to receive only subsequent change events.watchObjectLazy
void event each time the object stored under id changes, without fetching or returning the object itself. Use this when you want to re-fetch on change without paying for automatic deserialization on every event.
The document id to watch.
How often the underlying change watcher polls for updates.
When
true, the stream emits one event immediately on subscription before
waiting for the next change.watchCollectionLazy
void event each time any document in the collection changes, without returning the updated objects. Useful for cache-invalidation patterns where you manage the read yourself.
How often the underlying change watcher polls for updates.
When
true, the stream emits one event immediately on subscription before
waiting for the next change.