Wildcard / Included & Excluded Paths

From Ilianko

← Back to DP-420 Terminology Reference

Category: Optimization

Summary: Path expressions (with optional /* wildcard) controlling exactly which properties are indexed.

Overview

Indexing policies use included and excluded path expressions — optionally with a wildcard (/*) — to control precisely which properties (and nested properties) are indexed. A wildcard path like /properties/*/? indexes an entire subtree, while explicit exclusions (e.g., large or rarely-queried properties) reduce write RU cost and storage without a full custom rewrite of the policy for every property.

More Info & Links

DP-420 Style Practice Questions

Q1. What does a wildcard (/*) in an indexing policy path expression represent?

  • A. The entire subtree of properties beneath that path
  • B. Only the partition key property
  • C. A single specific property, never nested ones
  • D. A reference to a composite index

Q2. Why would you add a property to the excludedPaths of an indexing policy?

  • A. To reduce write RU cost and storage by skipping indexing of that property
  • B. To make the property queryable with ORDER BY
  • C. To enable geospatial queries on that property
  • D. To enforce a unique key constraint on that property

Answer Key

Answers are listed at the very end so you can attempt the questions first.

  • Q1 (Wildcard / Included & Excluded Paths): A. The entire subtree of properties beneath that path — A wildcard path expression like /path/* indexes every property in the subtree rooted at that path.
  • Q2 (Wildcard / Included & Excluded Paths): A. To reduce write RU cost and storage by skipping indexing of that property — Excluding a path from indexing avoids the write overhead of maintaining an index for properties that aren't queried.

DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page