Count Key Occurrences in Index

Is there a simple way to count the number of occurrences of keys in documents in an index?

For example:

Documents:
{"a":"blah","b":2}
{"a":"foo","c":4,"d":"baz"}
{"a":"bar","b":2,"c":1}

Result:
{"a":3, "b":2, "c":2, "d":1}

Or do I need to run an Exists query for each key?

Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.