Question 467 of 999

PCD resource.data Practice Question

This PCD practice question tests your understanding of deploy scalable and highly available databases in google cloud. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. A key principle to apply: resource.data. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A team is using Firestore for a mobile application. They need to write security rules that allow users to read and write only their own documents. The documents have a field 'ownerId' that matches the user's UID. Which THREE rule components should they use? (Choose 3.)

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 resource.data to access the document's fields.

The three core components for Firestore security rules that allow users to read/write only their own documents are: (A) resource.data to access document fields, (B) request.resource to validate incoming write data, and (E) request.auth to verify the user's identity. Option C is a complete rule that combines A and E, not a separate component. Option D is incorrect because exists() checks document existence, not field matching.

Key principle: resource.data

Answer analysis

Option-by-option breakdown

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

  • Use resource.data to access the document's fields.

    Why this is correct

    Correct. resource.data gives access to the current document's fields, such as 'ownerId'.

    Related concept

    resource.data

  • Use request.resource to validate incoming data during writes.

    Why this is correct

    Correct. request.resource represents the incoming data during writes, allowing validation that the new ownerId matches the user's UID.

    Related concept

    resource.data

  • Write a rule that allows read if request.auth.uid == resource.data.ownerId.

    Why it's wrong here

    Incorrect. While the rule uses components A and E, it is a full rule statement, not a component itself.

  • Use the exists() function to check if the ownerId field exists.

    Why it's wrong here

    Incorrect. exists() checks if a document exists, not if a field matches the owner's UID.

  • Use request.auth to verify user identity.

    Why this is correct

    Correct. request.auth provides the authenticated user's UID to compare against the ownerId field.

    Related concept

    resource.data

Common exam traps

Common exam trap: answer the scenario, not the keyword

This question asks for 'rule components' (building blocks), not complete rule statements. Option C is a complete rule, not a component.

Detailed technical explanation

How to think about this question

Treat this as a scenario question. Identify the problem, the constraint, and the best action. Then compare each option against those facts.

KKey Concepts to Remember

  • resource.data
  • request.resource
  • request.auth

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

resource.data

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Review resource.data, then practise related PCD questions on the same topic to reinforce the concept.

Related practice questions

Related PCD practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Manage a Solution that Can Span Multiple Database Systems practice questions

Practise PCD questions linked to Manage a Solution that Can Span Multiple Database Systems.

Deploy Scalable and Highly Available Databases in Google Cloud practice questions

Practise PCD questions linked to Deploy Scalable and Highly Available Databases in Google Cloud.

Design Scalable and Highly Available Cloud Database Solutions practice questions

Practise PCD questions linked to Design Scalable and Highly Available Cloud Database Solutions.

Migrate Data Solutions practice questions

Practise PCD questions linked to Migrate Data Solutions.

Designing highly scalable, available, and reliable cloud-native applications practice questions

Practise PCD questions linked to Designing highly scalable, available, and reliable cloud-native applications.

Building and testing applications practice questions

Practise PCD questions linked to Building and testing applications.

Deploying applications practice questions

Practise PCD questions linked to Deploying applications.

Integrating Google Cloud services practice questions

Practise PCD questions linked to Integrating Google Cloud services.

Managing application performance monitoring practice questions

Practise PCD questions linked to Managing application performance monitoring.

PCD fundamentals practice questions

Practise PCD questions linked to PCD fundamentals.

PCD scenario practice questions

Practise PCD questions linked to PCD scenario.

PCD troubleshooting practice questions

Practise PCD questions linked to PCD troubleshooting.

Practice this exam

Start a free PCD practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PCD question test?

Deploy Scalable and Highly Available Databases in Google Cloud — This question tests Deploy Scalable and Highly Available Databases in Google Cloud — resource.data.

What is the correct answer to this question?

The correct answer is: Use resource.data to access the document's fields. — The three core components for Firestore security rules that allow users to read/write only their own documents are: (A) resource.data to access document fields, (B) request.resource to validate incoming write data, and (E) request.auth to verify the user's identity. Option C is a complete rule that combines A and E, not a separate component. Option D is incorrect because exists() checks document existence, not field matching.

What should I do if I get this PCD question wrong?

Review resource.data, then practise related PCD questions on the same topic to reinforce the concept.

What is the key concept behind this question?

resource.data

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

Keep practising

More PCD practice questions

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 PCD 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 PCD exam.