Firebase Database Normalization

前端 未结 2 831
遇见更好的自我
遇见更好的自我 2021-01-20 03:58

So I made a simple app, a Tricycle Patrol app which you can report reckless tricycle drivers (no 1 problem here in our city) by logging in and filling up forms. The report f

2条回答
  •  没有蜡笔的小新
    2021-01-20 04:48

    I would suggest keeping reports separate and don't group them under users. just keep a reports id inside users record with created date as a value if you need to sort reports based on created date. Something like this

    reports
        9F0A756DF0B849CCAB7FAA0AC089475E
           - created_at:14804893896
           ...
        1C060A2CA16D42CF9DF53FD80A9C6ECA
        ADC4582B3C5746A487178887A495E005
    
    users
        F4C8F5642EC44727B929E3E408321122
            - email: ....
            - reports
                9F0A756DF0B849CCAB7FAA0AC089475E:14804893896
                1C060A2CA16D42CF9DF53FD80A9C6ECA:14865486878
        C9E0FAF081AC4447B0C194811314DF0F
    

提交回复
热议问题