extract method
Returns a map of the subset of documents in the store under the given path. Data for the given path can exist in two different places:
- It necessarily exists in all of the value stores resolved under the given path.
- It could exist in any of the parent value stores of the given path, such as in the example of the "users" path containing data for path users__1, users__1__friends__1, etc.
Implementation
Map<String, dynamic> extract([String path = '']) {
Map<String, dynamic> data = {};
final parentStores = _store.extractParentPath(path).values;
final childStores = _store.extractValues(path);
for (final parentStore in parentStores) {
data.addAll(parentStore.extract(path));
}
for (final childStore in childStores) {
data.addAll(childStore.extract(path));
}
return data;
}