Ultimate access to all questions.
Upgrade Now 🚀
Sign in to unlock AI tutor
How should you structure the data in Firestore when designing a chat room application that hosts multiple rooms and retains message history for each room?
A
Create a collection for the rooms. For each room, create a document that lists the contents of the messages
B
Create a collection for the rooms. For each room, create a collection that contains a document for each message
C
Create a collection for the rooms. For each room, create a document that contains a collection for documents, each of which contains a message.
D
Create a collection for the rooms, and create a document for each room. Create a separate collection for messages, with one document per message. Each room’s document contains a list of references to the messages.