0
0
Firebasecloud~5 mins

Array-contains queries in Firebase - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the array-contains query operator do in Firebase?
It finds documents where a specified array field contains a specific value.
Click to reveal answer
beginner
Can array-contains queries check for multiple values at once?
No, array-contains checks for only one value. To check multiple values, use array-contains-any.
Click to reveal answer
beginner
What type of field must you use array-contains on?
The field must be an array type in the document.
Click to reveal answer
intermediate
Is it possible to combine array-contains with other query filters?
Yes, you can combine array-contains with other filters like where clauses, but only one array-contains filter per query.
Click to reveal answer
beginner
What happens if you use array-contains on a field that is not an array?
The query will not match any documents because the field must be an array to contain values.
Click to reveal answer
What does the Firebase array-contains operator do?
AFinds documents where an array contains any of multiple values
BFinds documents where a string contains a substring
CFinds documents where an array field contains a specific value
DFinds documents where a number is greater than a value
Which operator allows checking if an array contains any of multiple values?
Aarray-contains-any
Barray-contains
Cin
Dwhere
How many array-contains filters can you use in a single Firebase query?
AUnlimited
BOne
CTwo
DNone
What type of field must be queried with array-contains?
AString
BBoolean
CNumber
DArray
If a field is not an array, what will happen when using array-contains?
AIt matches no documents
BIt throws an error
CIt matches documents with null values
DIt matches documents anyway
Explain how the array-contains query works in Firebase and when you would use it.
Think about searching for a value inside a list stored in a document.
You got /4 concepts.
    Describe the difference between array-contains and array-contains-any in Firebase queries.
    One is for single value, the other for multiple values.
    You got /4 concepts.