Trying to get a count of fields, just like the classic word count example. I thought this would be trivial...
but I got this useless result...
{"rows":[
{"key":null,"value":212785214}
]}
How can I get what I wanted... an inventory of all fields used in my documents, with a count of how many times they occur?
To get a count of each key in your document, create a "map" function like this:
and use the built in
_count
reducer.You can then retrieve the grouped answer by accessing the view like so:
which will produce grouped keys and counts like this: