Reputation: 23
This is how my data structure looks like
I would like to read all data in docs, except editor inside individual doc ids. is there a way to exclude a child data while doing a data snapshot?
Upvotes: 0
Views: 62
Reputation: 83068
No you cannot get only a subset of the data contained by a DataSnapshot.
If you want to keep the editor
value "secret", you should duplicate your data structure in another node (see example below) and apply some specific security rules on this new node.
- docs
- -LBWkGg....
- name //note that the editor node is absent
- owner
- ....
....
- secretData
- -LBWkGg.... //same Unique ID as the parent doc
- editor
....
- ....
....
Upvotes: 3