有大量关于构建Firebase数据的文章,但主要用于消息/产品视图应用程序,我相信我的情况相当特殊。而且,我做错了几次,所以我这次寻求帮助。
我的应用程序用于选择婴儿名称,用Ionic 2 / Angular 2编写,流程是这样的:
我需要做什么?
在我的姓名密钥视图中,我需要显示一个用户名单列表,对它们进行排序,搜索并能够更改属于用户列表的名称' unsorted'到了最喜欢的' /'不喜欢'如果我将视图更改为“收藏夹”,我需要执行相同操作,但将名称转移到其他两个列表中。
我的数据结构可能如下:
* UserList (depends on Facebook login)
- User UID
- name: 'FutureParent'
- UsersUnsortedList: List UID
- UsersFavouriteList: List UID
- UsersDislikedList: List UID
- properties
- preferedLanguage: 'en'
...
*UsersListOfNames (every user has its own)
- UserList UID
- belongsToUser: User UID
- namesContained:
- name 1 UID: 'true'
- name 2 UID: 'true'
* Default list of names (admin added, read only)
- DefaultListofNames UID
- listProperties
- icon: 'star'
- listName: 'Traditional Klingon Names'
...
- names
- name 1 UID: true
- name 2 UID: false
* Names (admin added, read only)
- name 1 UID
- name: 'Peter'
- nameHistory: 'Comes from whatever region ...'
- belongsToDefaultList:
- listID: DefaultListofNames UID 1
- text2: DefaultListofNames UID 2
- name 2 UID
...
我变平了吗?这是合适的设计吗?
非常感谢