IsarCollection<OBJ> class
abstract
Collections are used to store and receive your objects from Isar.
- Available Extensions
Constructors
Properties
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
ornull
if the object does not exist. -
getAll(
List< int> ids) → Future<List< OBJ?> > -
Get a list of objects by their
ids
ornull
if an object does not exist. -
getAllSync(
List< int> ids) → List<OBJ?> -
Get a list of objects by their
ids
ornull
if an object does not exist. -
getSync(
int id) → OBJ? -
Get a single object by
its
id ornull
if the object does not exist. -
importJson(
List< Map< json, {bool replaceOnConflict = false}) → Future<String, dynamic> >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< json, {bool replaceOnConflict = false}) → voidString, dynamic> > - Import a list of json objects.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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