🔥 3-day streak
Microsoft Azure Cosmos DB Developer Specialty (DP-420)95 / 104
Question 95 of 104

You maintain a Cosmos DB for NoSQL container of blog posts. Each document has a 'tags' array (up to 50 string entries) and a 'comments' array (up to 200 nested objects, each with an 'author' and 'likes' property). A dashboard query must return each post's title plus only the comments where 'likes' is greater than 100. The current query uses JOIN over the comments array and filters in the WHERE clause, but it returns a Cartesian-product row per matching comment and consumes high RU. What is the most efficient way to rewrite the query so each post yields a single result with the filtered comments?

Reviewed for accuracy · Report an issueNext question