Bird
0
0

Which of these is the correct way to represent a Firestore document field with a nested map?

easy📝 Syntax Q3 of 15
GCP - Cloud Firestore and Bigtable
Which of these is the correct way to represent a Firestore document field with a nested map?
A"address: city = NYC"
B["address", "city", "NYC"]
C{"address": {"city": "NYC", "zip": "10001"}}
Daddress: city, zip
Step-by-Step Solution
Solution:
  1. Step 1: Understand Firestore document field syntax

    Firestore fields use JSON-like key-value pairs; nested maps are objects inside objects.
  2. Step 2: Identify correct JSON representation

    {"address": {"city": "NYC", "zip": "10001"}} correctly shows a nested map with keys and values inside braces.
  3. Final Answer:

    {"address": {"city": "NYC", "zip": "10001"}} -> Option C
  4. Quick Check:

    Nested map = JSON object inside field [OK]
Quick Trick: Nested maps use JSON objects inside fields [OK]
Common Mistakes:
  • Using arrays instead of maps
  • Incorrect string formatting
  • Missing braces for nested objects

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes