Created
April 25, 2023 06:16
-
-
Save AyemunHossain/48c642965ea3aed9c8e7299cf4030529 to your computer and use it in GitHub Desktop.
Firebase Realtime Database indexing for query optimization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Data Format: | |
_DB | |
___Collction | |
______Sub Collection | |
__________Data | |
TestChatHistory --------------------------------------->(Main DB) | |
>268 ------------------------------------------------->(Collection) | |
>>2691680604235655 ----------------------------------->(Sub-collection) | |
----------groupChatRoomId : "2691680604235655" -------->(Data) | |
----------hisId:"0" | |
----------timestamp:1680604235865 | |
>>2691680607831444 | |
>>2701680602838840 | |
>269 | |
-------------------Firebase Roles------------------------ | |
{ | |
"rules": { | |
".write": "now < 1683741600000", // 2023-5-11 | |
"268": { | |
".indexOn": ["timestamp"] | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment