HF RL Explorer

Task: Count Number of Distinct Values Per Field in MongoDB

Task: Count Number of Distinct Values Per Field in MongoDB: a task in Terminal-Lego-15k (Harbor dataset). Write a MongoDB script that counts the number of distinct values for a specific field across all documents in a collection. The script should demonstrate how to determine how many unique…

The task

Write a MongoDB script that counts the number of distinct values for a specific field across all documents in a collection. The script should demonstrate how to determine how many unique country values exist in a collection without manually grouping and counting.

Part of PrimeIntellect/Terminal-Lego-15k.