Courseiva
Data Modeling →hardMultiple Choice

C100DEV Data Modeling Practice Question

Exhibit

{
  "product": "laptop",
  "specs": [
    { "k": "RAM", "v": "16GB" },
    { "k": "CPU", "v": "i7" }
  ]
}

Refer to the exhibit. The document uses the Attribute Pattern. Why is this model superior for indexing compared to storing specs as a single sub-document `{ RAM: '16GB', CPU: 'i7' }`?

⚠ Common exam trap

Candidates often think the Attribute pattern is only for organization. They fail to see that the real power lies in the ability to create a single index for arbitrary queries.

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

✓

It allows one index to cover any attribute query.

By using the Attribute Pattern with an array of key-value pairs, you can create a single multikey index on the 'specs.k' and 'specs.v' fields. This allows you to query any arbitrary attribute efficiently without having to create a separate index for every possible product specification. This approach provides a flexible, performant way to handle highly variable product schemas that would otherwise require hundreds of individual indexes.

Answer analysis

Option-by-option breakdown

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

  • ✗

    It reduces the document size compared to sub-documents.

    Why it's wrong here

    This structure actually increases the document size because you are repeating the 'k' and 'v' field names for every single attribute. The benefit is not storage savings, but index flexibility. You are trading a small amount of storage for a massive gain in query flexibility and indexing efficiency across the catalog.

  • ✓

    It allows one index to cover any attribute query.

    Why this is correct

    The Attribute Pattern with a multikey index on the key and value fields allows a single index to support queries on any attribute. This is superior to using sub-documents, which would require creating individual indexes for every attribute field, leading to an index explosion that degrades write performance and memory usage.

  • ✗

    It enforces strict schema validation for every attribute.

    Why it's wrong here

    The Attribute Pattern is inherently flexible and does not enforce schema validation on the contents of the 'v' field. Schema validation is handled by JSON Schema validators in MongoDB. This pattern is about indexing efficiency and query capability, not about adding strict schema enforcement to your document structure or business logic.

  • ✗

    It automatically performs joins between different products.

    Why it's wrong here

    The Attribute Pattern does not facilitate joins. Joins are handled by $lookup. This pattern is designed to solve the problem of indexing diverse fields within a single collection, allowing for high-performance queries without complex operations or the need to normalize your data into multiple collections for different product attributes.

About these practice questions

One of 259 original C100DEV practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official MongoDB exam blueprint

This C100DEV practice question is part of Courseiva's free MongoDB 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 C100DEV exam.