Consider that you have a collection called population which has fields state and city. Which of the following query will calculate the population grouped by state and city?
Suggested Answer: C
Get Premium C100DBA Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
12 comments · newest first
RO
Rory
1 month ago
No, A is wrong. $pop isn't a valid operator for this. C is definitely the best choice.
CA
Carma
1 month ago
I agree, but option A looks interesting too. It uses $pop, right?
BR
Brice
1 month ago
I think option C is correct. It sums population by state and city.
HU
Huey
2 months ago
Surprised that multi-document transactions aren't supported!
AR
Arthur
2 months ago
Definitely B, but it doesn't group by state.
CO
Colette
2 months ago
Wait, what's with the "Estate" typo in C and D?
CL
Clay
2 months ago
I think A is totally wrong.
NI
Nickolas
2 months ago
Option C looks correct to me.
DE
Deandrea
2 months ago
I'm confused about the syntax in D; it seems off with the "1 > > >" part. That can't be correct, right?
AN
Annabelle
3 months ago
I feel like I've seen a question similar to this before, and I think grouping by both state and city is key, so maybe C is right?
JO
Josphine
3 months ago
I remember practicing aggregation queries, but I can't recall if we used "$pop" or "$sum" for counting populations.
ME
Melvin
3 months ago
I think option C looks familiar, but I'm not sure if "Estate" is a typo or something else.