exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 182 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 182
Topic #: 1
[All Professional Cloud Developer Questions]

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?

  • 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.

Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
__rajan__
7 months, 1 week ago
Selected Answer: C
Community answer C.
upvoted 1 times
...
TNT87
1 year, 4 months ago
Answer C
upvoted 1 times
...
zellck
1 year, 4 months ago
Selected Answer: C
C is the answer. https://firebase.google.com/docs/firestore/data-model#hierarchical-data
upvoted 2 times
...
gardislan18
1 year, 5 months ago
Selected Answer: 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
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago