I am trying to use Firestore's new extension to delete all user data.
Their example documentation says the following:
Which paths in your Cloud Firestore instance contain user data? Leave empty if you don’t use Cloud Firestore. Enter the full paths, separated by commas. You can represent the User ID of the deleted user with {UID}. For example, if you have the collections users and admins, and each collection has documents with User ID as document IDs, then you can enter users/{UID},admins/{UID}.
However, the real data I need to delete are in other Collections whereby a foreign key equivalent is the user ID. I want to remove those values, for example, from the learnTransactions Collection that have UserID = the specific {UID}.
CodePudding user response:
With the "Delete User Data" extension it is not possible to delete documents based on a the value of one of their fields.
As you will see in the source of the Cloud Function implementing the extension, the documents are selected based on their paths and not with a where
query.
You could fork the code of the extension Cloud Function in order to adapt to your case and deploy your own Clown Function.