Collection<T> class abstract

Abstract baseclass for Collections of a specific type. DataStore subclasses must implement this to return a Collection which knows how to query and update a given collection/table in the datastore corresponding to a type.

Constructors

Collection(ClassInfo<T> classInfo)

Properties

classInfo ClassInfo<T>
Collection base class hols the classInfo, which is used to lookup static information about the type such as toJson/fromJson methods.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

byId(ObjectId id) Future<T?>
Subclasses must implement this to return a single object by id.
create(T object) Future<T>
Subclasses must implement this to create a single object in the datastore.
createMany(List<T> objects) Future<List<T>>
Subclasses must implement this to create multiple objects in the datastore.
find(SelectorBuilder selector) Stream<T>
Subclasses must implement this to return a stream of objects found with the given selector.
findOne(SelectorBuilder selector) Future<T?>
Subclasses must implement this to return a single object found with the given selector.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(ObjectId id, T update(T object)) Future<void>
Subclasses must implement this to update a single object by id. The update function is passed the current object and should return the updated object.
watchAdditions() Stream<T>
Subclasses must implement this to return a stream of objects as they are added to the collection.

Operators

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