I am using Firebase Translate Text Extension to translate few documents fields in my project. I want to add one more field that is in a documents in the nested collection:
So each document in collection "spots_test" has collection "reviews". I want to translate one field in each new review added, and I am wondering how can I set up it in Firebase Translate Text Extension, I was trying to set up something like this, but it didn't work:
Is there any way to handle nested collections?
I wasn't able to find proper documentation, however I experimented a bit. It seems to be working this way on my side (LevelOne
is collection, test
is sub-collection in any document of the collection):
LevelOne/{doc}/test
I don't think that it's important what is in the brackets I tested {something}
as well. Working fine.
As this is Firebase Function base feature, I tried the same wildcards logic as in Firebase Function background triggers for Firestore. To be honest, as I didn't found any documentation in extension docs so I am not sure if this is intended behavior, but it works.
UPDATE:
I have continued the test. The extension is generating function visible in Functions tab of Firebase console. The trigger is visible there. The value of the trigger is gendered from extension configuration "Collection path"+{messageId}
. So for example you can setup:
{collection}/{doc}/{subcollection}
In this situation translate text extension will work on every document in 2nd level collection no matter what the path is.