Courseiva

PCDE Practice Question: Manage a solution that can span multiple database technologies

Your Firestore database in Native mode contains a collection with millions of documents. You need to query documents where the 'tags' field (an array) contains the string 'urgent'. What must you ensure in your index configuration?

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

No additional index configuration is required; Firestore automatically creates the necessary index for array fields.

Firestore automatically creates a single-field index for array fields. However, to query array-contains, you need an index on the field with the array-contains filter. Firestore automatically creates a single-field index for the 'tags' field, so no additional index is needed. If the query includes additional equality clauses, a composite index may be required, but for a simple array-contains, it's automatic.

Answer analysis

Option-by-option breakdown

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

  • No additional index configuration is required; Firestore automatically creates the necessary index for array fields.

    Why this is correct

    Firestore automatically indexes array fields for array-contains queries.

  • Ensure the 'tags' field is not indexed, and then create a composite index with the array-contains filter.

    Why it's wrong here

    If the field is not indexed, you need to create an index, but Firestore auto-indexes fields by default.

  • Create an index exemption for the 'tags' field to enable array queries.

    Why it's wrong here

    Index exemptions are for excluding fields from automatic indexing, not for enabling queries.

  • Create a composite index on 'tags' and '__name__' for the collection.

    Why it's wrong here

    A composite index is not needed for a single array-contains query.

About these practice questions

Courseiva writes every PCDE question from scratch — 1,446 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.