ObjectDB class

ObjectDB

Inheritance

Constructors

ObjectDB(dynamic storage, {dynamic version = 1, OnUpgrade? onUpgrade})

Properties

hashCode int
The hash code for this object.
no setterinherited
onUpgrade OnUpgrade<Map>?
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
v int
finalinherited

Methods

cleanup() Future
trigger storage cleanup (f.e. condense storage file)
inherited
close() Future
close db
inherited
createItem(Map data) Map
convert dynamic map to concrete type T (opposite of itemToMap)
override
find([Map query = const {}, ListenerCallback? listener]) Future<List<Map>>
get all documents that match query with optional change-listener
inherited
first([Map query = const {}]) Future<Map>
get first document that matches query
inherited
insert(Map doc) Future<ObjectId>
insert document
inherited
insertMany(List<Map> docs) Future<List<ObjectId>>
insert many documents
inherited
itemToMap(Map item) Map
convert concrete type T to dynamic map (opposite of createItem)
override
last([Map query = const {}]) Future<Map>
get last document that matches query
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(dynamic query) Future<int>
remove documents that match query
inherited
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
inherited
wait() Future
returns future to await all previous db actions
inherited

Operators

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