grapher
grapher copied to clipboard
getCount does not work with post filter
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.
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 ?