Database class abstract

Service that provides Database implementations to apps.

Constructors

Database.fake(Map<dynamic, Map> database)
factory
Database.firestore({CacheManager? cacheManager})
factory

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

createRecord(String collectionPath, Map<String, dynamic> recordMap) Future<String?>
Creates a record as map for database inputs and returns the generated document id.
deleteFile(String recordPath) Future<bool>
Deletes a file from the database using the record path from storage. Returns true if the file was successfully deleted, false otherwise.
getCollection(String collectionPath, {List<DocumentQuery> filters, DocumentOrderBy? orderBy, int? limit}) Future<Map<String, Map>?>
Returns a map of documents records from the database.
getCollectionGroup(String collectionID, {List<DocumentQuery> filters, int? limit, DocumentOrderBy? orderBy}) Future<Map<String, Map>?>
Returns a map of documents records from the database. Each key of the returned map is a path to a document of a collection with a id collectionID.
getDownloadURL(String url) Future<String?>
Returns an download url from the database using the path file reference from storage.
getImage(String imageRef) Future<ImageProvider<Object>?>
Returns an image from the database using the image reference from storage.
getRecordByDocumentPath(String path) Future<Map?>
Returns a map representation of the documents.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeRecordByValue(String collectionPath, List<DocumentQuery> documentQueries) Future<void>
Removes all documents that match the query, from the specified collection.
removeRecordsByPath(String collectionPath, List<String> documentsIds) Future<void>
Removes all documents of collectionPath collection who have id in documentsIds list.
setFile(Uint8List fileData, String recordPath) Future<bool>
Sets a file to the database using the record path from storage and file.
setRecord({required String documentPath, required Map<String, dynamic> recordMap, bool merge = true}) Future<bool>
Set a data to the given documentPath. If the document does not exit at the given documentPath, data will be created. Otherwise, the document will be replaces by the given recordMap.
toString() String
A string representation of this object.
inherited
watchCollection(String collectionPath, {List<DocumentQuery> filters, int? limit, DocumentOrderBy? orderBy}) Stream<Map<String, Map>?>
Returns a Stream of map of documents records from the database.
watchCollectionGroup(String collectionID, {List<DocumentQuery> filters, int? limit, DocumentOrderBy? orderBy}) Stream<Map<String, Map>?>
Returns a stream of map of documents records from the database. Each key of the returned map is a path to a document of a collection with a id collectionID.
watchRecordByDocumentPath(String path) Stream<Map?>
Returns a Stream of map of documents.

Operators

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