I've recently started working with Firebase and in one of the demo-apps I've implemented something tinder like. You can basically swipe users and after swiping one I'm storing the data in the following format/path:
matches/randomeFirebaseID()/{
userid: true
otherUserid: true
}
That's pretty nice to query them again BUT how can I make a security-rule that doesn't allow duplicated entries like that. Is that even possible with security-rules? Or should I structure the data in another form? It would be possible to simply query them beforehand and check if a match already exists, but that takes some extra time I don't want to waste.
Thanks for your help!