DatabaseUniverseCollection<ID, OBJ> class
abstract
Use DatabaseUniverseCollection
instances to find, query, and create new objects of a
given type in DatabaseUniverse.
You can get an instance of DatabaseUniverseCollection
by calling databaseUniverse.get<OBJ>()
or
by using the generated databaseUniverse.yourCollections
getter.
- Available extensions
Constructors
Properties
- databaseUniverse → DatabaseUniverse
-
The corresponding DatabaseUniverse instance.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema → DatabaseUniverseSchema
-
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}) → DatabaseUniverseQuery<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
. Returnsnull
if the object does not exist. -
getAll(
List< ID> ids) → List<OBJ?> -
Get a list of objects by their
ids
. Objects in the list arenull
if they don't exist. -
getAllAsync(
List< ID> ids) → Future<List< OBJ?> > -
Available on DatabaseUniverseCollection<
Get a list of objects by theirID, OBJ> , provided by the CollectionAsync extensionids
. Objects in the list arenull
if they don't exist. -
getAsync(
ID id) → Future< OBJ?> -
Available on DatabaseUniverseCollection<
Get a single object by itsID, OBJ> , provided by the CollectionAsync extensionid
. Returnsnull
if the object does not exist. -
getSize(
{bool includeIndexes = false}) → int - Calculates the size of the collection in bytes.
-
importJson(
List< Map< json) → intString, dynamic> > - 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