IsarCollection<OBJ> class Null safety

Collections are used to store and receive your objects from Isar.

Constructors

IsarCollection()

Properties

hashCode int
The hash code for this object.
read-only, inherited
isar Isar
The corresponding Isar instance.
read-only
name String
The name of the collection.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

buildQuery<R>({List<WhereClause> whereClauses = const [], bool whereDistinct = false, Sort whereSort = Sort.asc, FilterOperation? filter, List<SortProperty> sortBy = const [], List<DistinctProperty> distinctBy = const [], int? offset, int? limit, String? property}) Query<R>
Build a query dynamically. Can be used to build a custom query language.
clear() Future<void>
Remove all data in this collection and reset the auto increment value.
clearSync() → void
Remove all data in this collection and reset the auto increment value.
count() Future<int>
Returns the total number of objects in this collection
countSync() int
Returns the total number of objects in this collection
delete(int id) Future<bool>
Delete a single object by its id.
deleteAll(List<int> ids) Future<int>
Delete a list of objecs by their ids.
deleteAllSync(List<int> ids) int
Delete a list of objecs by their ids.
deleteSync(int id) bool
Delete a single object by its id.
filter() QueryBuilder<OBJ, OBJ, QFilterCondition>
Start building a query using the QueryBuilder.
get(int id) Future<OBJ?>
Get a single object by its id or null if the object does not exist.
getAll(List<int> ids) Future<List<OBJ?>>
Get a list of objects by their ids or null if an object does not exist.
getAllSync(List<int> ids) List<OBJ?>
Get a list of objects by their ids or null if an object does not exist.
getSync(int id) → OBJ?
Get a single object by its id or null if the object does not exist.
importJson(List<Map<String, dynamic>> json, {bool replaceOnConflict = false}) Future<void>
Import a list of json objects.
importJsonRaw(Uint8List jsonBytes, {bool replaceOnConflict = false}) Future<void>
Import a list of json objects.
importJsonRawSync(Uint8List jsonBytes, {bool replaceOnConflict = false}) → void
Import a list of json objects.
importJsonSync(List<Map<String, dynamic>> json, {bool replaceOnConflict = false}) → void
Import a list of json objects.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
put(OBJ object, {bool replaceOnConflict = false, bool saveLinks = false}) Future<int>
Insert or update an object and returns the assigned id.
putAll(List<OBJ> objects, {bool replaceOnConflict = false, bool saveLinks = false}) Future<List<int>>
Insert or update a list of objects and returns the list of assigned ids.
putAllSync(List<OBJ> objects, {bool replaceOnConflict = false, bool saveLinks = false}) List<int>
Insert or update a list of objects and returns the list of assigned ids.
putSync(OBJ object, {bool replaceOnConflict = false, bool saveLinks = false}) int
Insert or update an object and returns the assigned id.
toString() String
A string representation of this object.
inherited
watchLazy() Stream<void>
Watch the collection for changes.
watchObject(int id, {bool initialReturn = false}) Stream<OBJ?>
Watch an object with id for changes.
watchObjectLazy(int id) Stream<void>
Watch an object with id for changes.
where({bool distinct = false, Sort sort = Sort.asc}) QueryBuilder<OBJ, OBJ, QWhere>
Start building a query using the QueryBuilder.

Operators

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