简体   繁体   中英

How to structure a Firebase Realtime-Database?

I am trying to set up a Google Firebase Realtime Database to store user data. I am really new to Java and Firebase and until now user data gets saved just under the Uid. I now want to have different categories like Users, Posts, Messages... How can I add such a structure to my Database? I will link a Screenshot of my Database. I am completely new to those things and don't even know in which file I can add such a structure.

实时数据库映像

You can structure your database something like this:

Users:

Users -> uid(With users information.)

Posts

Posts -> user_id -> post_id(with post details)

Messages:

Message -> user_id -> messages (with message and receiver id.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM