Topic 1 Question 182
You are designing a chat room application that will host multiple rooms and retain the message history for each room. You have selected Firestore as your database. How should you represent the data in Firestore?
Create a collection for the rooms. For each room, create a document that lists the contents of the messages

Create a collection for the rooms. For each room, create a collection that contains a document for each message

Create a collection for the rooms. For each room, create a document that contains a collection for documents, each of which contains a message.

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.

ユーザの投票
コメント(3)
- 正解だと思う選択肢: C
Answer is C. "The best way to store messages in this scenario is by using subcollections. A subcollection is a collection associated with a specific document."
https://firebase.google.com/docs/firestore/data-model#subcollections
👍 1gardislan182022/12/04 - 正解だと思う選択肢: C👍 1zellck2022/12/15
Answer C
👍 1TNT872022/12/25
シャッフルモード