IsarCollection<ID, OBJ> class abstract

Use IsarCollection instances to find, query, and create new objects of a given type in Isar.

You can get an instance of IsarCollection by calling isar.get<OBJ>() or by using the generated isar.yourCollections getter.

Available Extensions

Constructors

IsarCollection()

Properties

hashCode int
The hash code for this object.
no setterinherited
isar Isar
The corresponding Isar instance.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema IsarSchema
The schema of this collection.
no setter

Methods

autoIncrement() int
Fetch the next auto increment id for this collection.
buildQuery<R>({Filter? filter, List<SortProperty>? sortBy, List<DistinctProperty>? distinctBy, List<int>? properties}) IsarQuery<R>
Build a query dynamically for example to build a custom query language.
clear() → void
Remove all data in this collection and reset the auto increment value.
count() int
Returns the total number of objects in this collection.
delete(ID id) bool
Delete a single object by its id.
deleteAll(List<ID> ids) int
Delete a list of objects by their ids.
get(ID id) → OBJ?
Get a single object by its id. Returns null if the object does not exist.
getAll(List<ID> ids) List<OBJ?>
Get a list of objects by their ids. Objects in the list are null if they don't exist.
getSize({bool includeIndexes = false}) int
Calculates the size of the collection in bytes.
importJson(List<Map<String, dynamic>> json) int
Import a list of json objects.
importJsonString(String json) int
Import a list of json objects.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(OBJ object) → void
Insert or update the object.
putAll(List<OBJ> objects) → void
Insert or update a list of objects.
toString() String
A string representation of this object.
inherited
updateProperties(List<ID> ids, Map<int, dynamic> changes) int
This is a low level method to update objects.
watchLazy({bool fireImmediately = false}) Stream<void>
Watch the collection for changes.
watchObject(ID id, {bool fireImmediately = false}) Stream<OBJ?>
Watch the object with id for changes. If a change occurs, the new object will be returned in the stream.
watchObjectLazy(ID id, {bool fireImmediately = false}) Stream<void>
Watch the object with id for changes.
where() QueryBuilder<OBJ, OBJ, QStart>
Start building a query using the QueryBuilder.

Operators

operator ==(Object other) bool
The equality operator.
inherited