1

In my map reduce which gets a count I don’t want the document to show up in my results where the count is 0 so how can I exclude them from showing up in the results, I assume I would do it in the Finalize function but how do I delete the document where count = 0.

Can i do something like this, and how do i do it?

function Finalize(key, reduced) {

if reduced.count == 0 {
delete reduced;
}
    return reduced;
}
Dorf
  • 229
  • 6
  • 15

1 Answers1

3

Finalize cannot exclude documents from being output. You can remove all the data, save the id, but the document will be returned/recorded.

Here is the issue to watch/vote.

Scott Hernandez
  • 7,452
  • 2
  • 34
  • 25