I wanted to count all key's of my documents (inclusive embedded ones) of a collection.
First I wrote a Java client to solve this. It took less than 4 seconds to ...
{id: 1, text: "This is a sentence about dogs", indices: ["sentence", "dogs"]}
{id: 2, text: "This sentence is about cats and dogs", indices: ["sentence", "cats", "dogs"]}