CRUDController<T> class abstract

Implementers

Constructors

CRUDController(StorageInterface _storage)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cleanup() Future
trigger storage cleanup (f.e. condense storage file)
createItem(Map data) → T
convert dynamic map to concrete type T (opposite of itemToMap)
find([Map query = const {}, ListenerCallback? listener]) Future<List<T>>
get all documents that match query with optional change-listener
first([Map query = const {}]) Future<T>
get first document that matches query
insert(T doc) Future<ObjectId>
insert document
insertMany(List<T> docs) Future<List<ObjectId>>
insert many documents
itemToMap(T item) Map
convert concrete type T to dynamic map (opposite of createItem)
last([Map query = const {}]) Future<T>
get last document that matches query
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(dynamic query) Future<int>
remove documents that match query
toString() String
A string representation of this object.
inherited
update(Map query, Map changes, [bool replace = false]) Future<int>
update database, takes query, changes and an optional replace flag
wait() Future
returns future to await all previous db actions

Operators

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