DocumentMapper class
Mapper for Firestore documents and collections to JSON and vice versa.
Constructors
- DocumentMapper({required ValueMapper valueUtils, required PathUtils pathUtils})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- metaCollections → String
-
Document inner collections
no setter
- metaCreateTime → String
-
Creation datetime
no setter
- metaDocuments → String
-
Collection documents
no setter
- metaName → String
-
Document name
no setter
- metaUpdateTime → String
-
Last update datetime
no setter
- pathUtils → PathUtils
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valueUtils → ValueMapper
-
final
Methods
-
collectionToJson(
{required String path, List< Document> documents = const []}) → JsonObject -
Converts a collection of Firestore
Documents to a JSON object. -
documentToJson(
Document document) → JsonObject -
Converts a Firestore
Documentto a JSON object. -
init(
{String? metaPrefix}) → void -
jsonToCollection(
{required String path, required JsonObject json, required OnParsedCallback onParsed, String? changeRootName}) → Future< void> - Converts a JSON object to a Firestore collection and its documents.
-
jsonToDocument(
{required String path, required JsonObject json, required OnParsedCallback onParsed, String? changeRootName}) → Future< void> - Converts a JSON object to a Firestore document and its inner collections.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- kDefaultMetaPrefix → const String
- Prefix for special fields in Firestore documents.