Courseiva
Question 534 of 1,446

PCDE Automatic indexing Practice Question

A development team is using Firestore in Native mode. They want to ensure that queries on array fields return correct results. Which two actions should they take? (Choose TWO.)

⚠ Common exam trap

A common trap is thinking that array fields require special manual indexing or that index exemptions are needed for queries to work. In reality, automatic indexing covers array fields, and exemptions only serve to exclude fields to reduce costs or meet specific requirements.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use the 'array-contains' operator only on indexed arrays.

Firestore automatically creates single-field indexes for all fields, including array fields. This means the array-contains operator works without manual indexing, provided the field has not been excluded via index exemptions. However, to ensure queries return correct results, developers must understand that array fields are indexed by default (E) and that array-contains only works on indexed arrays (C). Option B is incorrect because disabling indexing via exemptions would prevent array-contains queries from working.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create a composite index for every query involving array fields.

    Why it's wrong here

    Creating a composite index for every query is unnecessary; simple array-contains queries only need a single-field index, which is created automatically.

  • Set index exemptions for arrays and maps to disable automatic indexing.

    Why it's wrong here

    Setting index exemptions disables automatic indexing, which would prevent array-contains queries from working correctly.

  • Use the 'array-contains' operator only on indexed arrays.

    Why this is correct

    Correct. The array-contains operator can only be used on fields that are indexed. Since Firestore auto-indexes array fields, this is typically satisfied unless exemptions are set.

  • Manually create indexes for each array field in the Firestore console.

    Why it's wrong here

    Manually creating indexes for each array field is redundant because Firestore already auto-indexes them.

  • Understand that array fields are automatically indexed as single-field indexes.

    Why this is correct

    Correct. Knowing that array fields are automatically indexed as single-field indexes is key to understanding how array-contains queries work.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCDE exam.