get method
Sends a get requests to the database to read some data.
Tries to read the data at path
, or the whole virtual root, if not set.
The printMode
and formatMode
can be used to control how data is
formatted by the server.
The shallow
parameter can be used to help you work with large datasets
without needing to download everything. Set this to true to limit the
depth of the data returned at a location. If the data at the location is
a JSON primitive (string, number or boolean), its value will simply be
returned. If the data snapshot at the location is a JSON object, the
values for each key will be truncated to true.
If filter
is added, that filter will be applied to filter the results
returned by the server. See Filter for more details.
Finally, the eTag
parameter can be set to true to request an eTag for
the given data.
Implementation
Future<DbResponse> get({
String? path,
PrintMode? printMode,
FormatMode? formatMode,
bool? shallow,
Filter? filter,
bool eTag = false,
}) async {
final response = await client.get(
_buildUri(
path: path,
filter: filter,
printMode: printMode,
formatMode: formatMode,
shallow: shallow,
),
headers: _buildHeaders(
eTag: eTag,
),
);
return _parseResponse(response, eTag);
}