سؤال

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;
}
هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top