Bird
0
0

Given this Firestore query in Python:

medium📝 Predict Output Q4 of 15
GCP - Cloud Firestore and Bigtable
Given this Firestore query in Python:
docs = firestore_client.collection('products').where('price', '>', 100).stream()

What does this code return?
AAll products regardless of price
BAll products with price less than 100
CAll products with price equal to 100
DAll products with price greater than 100
Step-by-Step Solution
Solution:
  1. Step 1: Understand Firestore query filter

    The where clause filters documents where 'price' field is greater than 100.
  2. Step 2: Interpret the stream() method

    stream() returns an iterator over matching documents, so only products with price > 100 are returned.
  3. Final Answer:

    All products with price greater than 100 -> Option D
  4. Quick Check:

    Firestore where '>' filter = products priced above 100 [OK]
Quick Trick: where('field', '>', value) filters greater values [OK]
Common Mistakes:
  • Confusing greater than with less than
  • Assuming equality filter
  • Ignoring the where clause effect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes