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?✗ Incorrect
array-contains checks if a specific value exists inside an array field in documents.
Which operator allows checking if an array contains any of multiple values?
✗ Incorrect
array-contains-any checks if the array contains at least one value from a list.
How many
array-contains filters can you use in a single Firebase query?✗ Incorrect
Firebase allows only one array-contains filter per query.
What type of field must be queried with
array-contains?✗ Incorrect
The field must be an array to use array-contains.
If a field is not an array, what will happen when using
array-contains?✗ Incorrect
The query will not match any documents if the field is not an array.
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.