简体   繁体   中英

Flutter Firebase Database store/ read data by date

I'm new to NoSql schema design. I would like to store some race schedule, this is how i do it now.

/{Year}
------>/{Month}
------>------>/{Day}
------>------>------/{raceNumber}
------>------>------>------>/{raceMeta}

在此处输入图像描述

I have the following questions:

  1. Is it possible to retrieve a result like
["dd/mm/YYYY",...] 

or

["2018":
        ["01":
              ["01":...],
              ...
        ...
        ],
 "2019":
...]

, without initializing all child node? I've found shallow query for Firebase, but seems it can only query the single layer.

  1. Is this a good design/practice to structure such data in that way?

Thanks for the help!

  1. I would like to have an function to navigate through records, for example selecting a date from a list of dates from the database, and by simply clicking arrows to move forward/ backward, how can I archive that?

Change the format of date from 31/12/2022 to 31-12-2022 and you are good to go.

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