Firebase realtime database rules check if node with a certain key exists across all nodes
I have a node "purchasetokens" - "$userId" - ""$purchaseToken"" and a key "valid:True/False" that is set by my cloud function only. How can I set a rule to make sure that the "$purchaseToken" doesn't exists across all "$userId" with a…