Task: Demonstrate MongoDB's $unwind Operator
Task: Demonstrate MongoDB's $unwind Operator: a task in Terminal-Lego-15k (Harbor dataset). Write a MongoDB script that demonstrates the $unwind aggregation operator by creating a collection of articles (where each article has an array of tags), and then using the aggregation pipeline with…
The task
Write a MongoDB script that demonstrates the `$unwind` aggregation operator by creating a collection of articles (where each article has an array of tags), and then using the aggregation pipeline with `$project` and `$unwind` to flatten the tags array so that each document in the output contains a single tag value.
Part of PrimeIntellect/Terminal-Lego-15k.