Given the following data structure and ruleset, how would I retrieve all data
objects across all keys without knowing the keys upfront?
Database:
{
"items": {
"abcd1234": {
"data" : {"name": "Foo"},
"users": { "zcds123": true }
}
}
}
Rules:
{
"items": {
"$itemId": {
"data" { ".read": true },
"users": {
"$uid": {
".read": "$uid === auth.uid"
}
}
}
}
}
I'm trying something like:
firebase.database().ref('items/*/data').once('value');
however calling result.val()
returns null
. What am I missing?
Is it possible to do this or do I need to put the public data under a separate key?