grapher icon indicating copy to clipboard operation
grapher copied to clipboard

getCount does not work with post filter

Open wajatimur opened this issue 6 years ago • 1 comments

The getCount function does not work when using $postFilters. It seems returning the total count of record but fetch function with same $postFilters did return the correct records.

wajatimur avatar Apr 12 '18 11:04 wajatimur

You are correct, the problem here is that we use the actual .count() method from MongoDB, so we don't retrieve the data from server, so we have nothing to apply postFilters to. I agree that this is a bit counter-intuitive, maybe we could display a warning, but currently I don't think we can avoid this, maybe we can send a custom $where to allow MongoDB to execute javascript in there ?

theodorDiaconu avatar Apr 17 '18 08:04 theodorDiaconu