DocumentRef class
A DocumentRef refers to a document location in a Localstore database and can be used to write, read, or listen to the location.
The document at the referenced location may or may not exist. A DocumentRef can also be used to create a CollectionRef to a subcollection.
- Implemented types
Constructors
- DocumentRef(String id, [CollectionRef? delegate])
-
Returns an instance using the default DocumentRef.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
This document's given ID within the collection.
no setter
- path → String
-
A string representing the path of the referenced document (relative to the
root of the database).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
collection(
String id) → CollectionRef -
Gets a CollectionRef for the specified Localstore path.
override
-
delete(
) → Future -
Deletes the current document from the collection.
override
-
get(
) → Future< Map< String, dynamic> ?> -
Reads the document referenced by this DocumentRef.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
Map< String, dynamic> data, [SetOptions? options]) → Future -
Sets data on the document, overwriting any existing data. If the document
does not yet exist, it will be created.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited