private function validateAggregationOptions(array $options)
    {
        // get db version
        $client = $this->getDatabase()->getClient();
        $dbVersion = $client->getDbVersion();

        // check options for db < 2.6
        if (version_compare($dbVersion, '2.6.0', '<')) {
            if (!empty($options['explain'])) {
                throw new FeatureNotSupportedException(
                    'Explain of aggregation implemented only from 2.6.0'
                );
            }

            if (!empty($options['allowDiskUse'])) {
                throw new FeatureNotSupportedException(
                    'Option allowDiskUse of aggregation implemented only from 2.6.0'
                );
            }

            if (!empty($options['cursor'])) {
                throw new FeatureNotSupportedException(
                    'Option cursor of aggregation implemented only from 2.6.0'
                );
            }
        }

        // check options for db < 3.2
        if (version_compare($dbVersion, '3.2.0', '<')) {
            if (!empty($options['bypassDocumentValidation'])) {
                throw new FeatureNotSupportedException(
                    'Option bypassDocumentValidation of aggregation implemented only from 3.2.0'
                );
            }

            if (!empty($options['readConcern'])) {
                throw new FeatureNotSupportedException(
                    'Option readConcern of aggregation implemented only from 3.2.0'
                );
            }
        }
    }
private function validateAggregationOptions(array $options)
    {
        // get db version
        $client = $this->getDatabase()->getClient();
        $dbVersion = $client->getDbVersion();

        // check options for db < 2.6
        if (version_compare($dbVersion, '2.6.0', '<')) {
            if (!empty($options['explain'])) {
                throw new FeatureNotSupportedException(
                    'Explain of aggregation implemented only from 2.6.0'
                );
            }

            if (!empty($options['allowDiskUse'])) {
                throw new FeatureNotSupportedException(
                    'Option allowDiskUse of aggregation implemented only from 2.6.0'
                );
            }

            if (!empty($options['cursor'])) {
                throw new FeatureNotSupportedException(
                    'Option cursor of aggregation implemented only from 2.6.0'
                );
            }
        }

        // check options for db < 3.2
        if (version_compare($dbVersion, '3.2.0', '<')) {
            if (!empty($options['bypassDocumentValidation'])) {
                throw new FeatureNotSupportedException(
                    'Option bypassDocumentValidation of aggregation implemented only from 3.2.0'
                );
            }

            if (!empty($options['readConcern'])) {
                throw new FeatureNotSupportedException(
                    'Option readConcern of aggregation implemented only from 3.2.0'
                );
            }
        }
    }
private function validateAggregationOptions ( array $ options ) { // get db version $ client = $ this -> getDatabase ( ) -> getClient ( ) ; $ dbVersion = $ client -> getDbVersion ( ) ; // check options for db < 2.6 if ( version_compare ( $ dbVersion , '2.6.0' , '<' ) ) { if ( ! empty ( $ options [ 'explain' ] ) ) { throw new FeatureNotSupportedException ( 'Explain of aggregation implemented only from 2.6.0' ) ; } if ( ! empty ( $ options [ 'allowDiskUse' ] ) ) { throw new FeatureNotSupportedException ( 'Option allowDiskUse of aggregation implemented only from 2.6.0' ) ; } if ( ! empty ( $ options [ 'cursor' ] ) ) { throw new FeatureNotSupportedException ( 'Option cursor of aggregation implemented only from 2.6.0' ) ; } } // check options for db < 3.2 if ( version_compare ( $ dbVersion , '3.2.0' , '<' ) ) { if ( ! empty ( $ options [ 'bypassDocumentValidation' ] ) ) { throw new FeatureNotSupportedException ( 'Option bypassDocumentValidation of aggregation implemented only from 3.2.0' ) ; } if ( ! empty ( $ options [ 'readConcern' ] ) ) { throw new FeatureNotSupportedException ( 'Option readConcern of aggregation implemented only from 3.2.0' ) ; } } }
Check if aggragator options supported by database

@param array $options
@throws FeatureNotSupportedException
Check if aggragator options supported by database