Bird
0
0

Given this request:

medium📝 Predict Output Q5 of 15
Elasticsearch - Document Operations
Given this request:
PUT /users/_doc/42
{
  "name": "Alice",
  "age": 30
}

What will happen if a document with ID 42 already exists?
AAn error will be returned
BThe document will be replaced with the new data
CA new document will be created with a different ID
DThe request will be ignored
Step-by-Step Solution
Solution:
  1. Step 1: Understand PUT with existing document ID

    PUT replaces the existing document with the new content.
  2. Step 2: Confirm no error or new document creation

    PUT does not error or create a new document with a different ID.
  3. Final Answer:

    The document will be replaced with the new data -> Option B
  4. Quick Check:

    PUT with existing ID replaces document [OK]
Quick Trick: PUT updates existing document by ID [OK]
Common Mistakes:
MISTAKES
  • Expecting error on duplicate ID
  • Thinking PUT creates new ID
  • Ignoring document replacement behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes