private function filterCursor($postAggregates = false)
    {
        $filter = $this->getFilter();

        if ($filter) {
            if ($filter->requiresAggregation($this) && !$postAggregates) {
                return;
            }

            if (!$filter->requiresAggregation($this) && $postAggregates) {
                return;
            }

            $uniqueIdentifiersToFilter = [];

            foreach ($this->collectionCursor as $model) {
                if ($filter->shouldFilter($model)) {
                    if (!isset($uniqueIdentifiersToFilter[$model->getUniqueIdentifier()])) {
                        $uniqueIdentifiersToFilter[$model->uniqueIdentifier] = true;
                    }
                } else {
                    $uniqueIdentifiersToFilter[$model->uniqueIdentifier] = false;
                }
            }

            $idsToFilter = array_keys(array_filter($uniqueIdentifiersToFilter, function($value, $key){
                return $value;
            }, ARRAY_FILTER_USE_BOTH));

            $this->collectionCursor->filterModelsByIdentifier($idsToFilter);
        }
    }