protected function overrideParameters($options, ContainerBuilder $container)
    {
        $overrides = [
            'proxy_namespace',
            'proxy_dir',
            'auto_generate_proxy_classes',
            'hydrator_namespace',
            'hydrator_dir',
            'auto_generate_hydrator_classes',
            'default_commit_options',
            'persistent_collection_dir',
            'persistent_collection_namespace',
            'auto_generate_persistent_collection_classes',
        ];

        foreach ($overrides as $key) {
            if (! isset($options[$key])) {
                continue;
            }

            $container->setParameter('doctrine_mongodb.odm.' . $key, $options[$key]);

            // the option should not be used, the parameter should be referenced
            unset($options[$key]);
        }

        return $options;
    }