Bird
0
0

Which JSON snippet correctly defines an explicit mapping for a field age as an integer?

easy📝 Syntax Q12 of 15
Elasticsearch - Mappings and Data Types
Which JSON snippet correctly defines an explicit mapping for a field age as an integer?
A{"mappings": {"properties": {"age": "number"}}}
B{"mappings": {"age": {"type": "text"}}}
C{"properties": {"age": "integer"}}
D{"mappings": {"properties": {"age": {"type": "integer"}}}}
Step-by-Step Solution
Solution:
  1. Step 1: Check correct mapping structure

    Explicit mapping requires "mappings" with "properties" and field name with type inside.
  2. Step 2: Verify field type for age

    "age" field must have "type": "integer" to define it as integer.
  3. Final Answer:

    {"mappings": {"properties": {"age": {"type": "integer"}}}} -> Option D
  4. Quick Check:

    Correct JSON structure with integer type [OK]
Quick Trick: Explicit mapping needs mappings > properties > field > type [OK]
Common Mistakes:
MISTAKES
  • Missing 'properties' level in JSON
  • Using wrong type names like 'number' instead of 'integer'
  • Placing fields outside 'mappings'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes