Only allow unique values in Firebase Realtime Database [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 02:44:25

问题


Here's my data structure:

root
---+ mydata
    |--- -KqI0uf--1-bD3oLlx2h:"Joe"
    |--- -Kdk0bf--1-bx0oLlb9a:"Mike"
    |--- -Kox8gf--1-b36onlT3h:"Eve"

How do I write a rule to only allow unique values in my Firebase Realtime Database?

For example, I don't want this to happen:

root
---+ mydata
    |--- -KqI0uf--1-bD3oLlx2h:"Boss"
    |--- -Kdk0bf-3-bx0oLlb9a:"Bob"
    |--- -Kox8gf1-b36onlT3h:"Dot"
    |--- -Kbx8gff-1-b92ksvT7:"Bob" // this should not exist

来源:https://stackoverflow.com/questions/45399151/only-allow-unique-values-in-firebase-realtime-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!