Creating Nested Object Firebase structure

前端 未结 1 1488

I\'m using Firebase as my database for my Android project. In this project, I have users with minimal data associated with them.

    users{
      1234-567-89         


        
相关标签:
1条回答
  • 2020-12-21 15:23

    These seem to be the minimal classes needed for your data:

    public class Event {
      public String name;
      public Long startTime;
      public Long endTime;
    }
    
    public class User { 
      public String Display;
      public String Email;
      public Map<String, Event> Schedule;
    }
    

    The Schedule is a map, where the keys are event1 and event2.

    I didn't add Schedule2 because its type is unspecified.

    0 讨论(0)
提交回复
热议问题