0
0
Firebasecloud~10 mins

Supported data types in Firebase - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a Firestore document field with a supported data type.

Firebase
docRef.set({"age": [1])
Drag options to blanks, or click blank then click option'
A25
Bundefined
C"twenty-five"
Dfunction() {}
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported types like functions or undefined
Using strings when a number is expected
2fill in blank
medium

Complete the code to add a timestamp field using Firestore's supported data types.

Firebase
docRef.set({"createdAt": [1])
Drag options to blanks, or click blank then click option'
Anew Date()
Bfirebase.firestore.Timestamp.now()
C"2024-01-01"
DDate.now()
Attempts:
3 left
💡 Hint
Common Mistakes
Using plain Date objects or strings instead of Firestore Timestamp
Using numeric timestamps directly
3fill in blank
hard

Fix the error in the code to store a supported array type in Firestore.

Firebase
docRef.set({"tags": [1])
Drag options to blanks, or click blank then click option'
A["cloud", "firebase"]
B{"cloud": true, "firebase": true}
Cundefined
Dnew Set(["cloud", "firebase"])
Attempts:
3 left
💡 Hint
Common Mistakes
Using objects or sets instead of arrays
Using undefined or null values
4fill in blank
hard

Fill both blanks to correctly store a nested map with supported data types in Firestore.

Firebase
docRef.set({"user": {"name": [1], "age": [2])
Drag options to blanks, or click blank then click option'
A"Alice"
B30
Cnull
Dundefined
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined or null values
Using wrong data types for fields
5fill in blank
hard

Fill all three blanks to correctly store different supported Firestore data types in a document.

Firebase
docRef.set({"active": [1], "score": [2], "joined": [3])
Drag options to blanks, or click blank then click option'
Atrue
B85.5
Cfirebase.firestore.Timestamp.now()
D"yes"
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings instead of booleans
Using plain Date objects instead of Firestore Timestamp