I need to verify that the 'category' attribute has its value equal to a key existing on the category node
I tried this:
type VerifyCategoryExists extends String { validate() { prior(root.categories['categories-list'][this]) != null } } }
That generated this:
".validate": "(newData.isString() && root.child('categories').child('categories-list').child(data.val()).val() != null)"
But I wanted this (I tested without using the bolt and it worked):
".validate": "(newData.isString() && root.child('categories').child('categories-list').hasChild(newData.val()))"
How do I get to the expected result but using the bolt?