I am trying to figure out how to get an array from the path on an update or create in order to create validators based on the path data:
function test() {
// option 1
return string(request.path).split('/')[0] == 'databases';
// option 2
// return string(request.resource.__name__).split('/')[0] == 'databases';
}
match /posts/{document} {
allow update: if test();
...
}
I have tried both of the previous examples with request.resource.__name__ and request.path... How do I parse the data out of the requested path?
Thanks,
J