diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml
index e57b10f9..32444a03 100644
--- a/.github/workflows/coding-standards.yml
+++ b/.github/workflows/coding-standards.yml
@@ -4,6 +4,7 @@ on:
   pull_request:
     branches:
       - "*.x"
+      - "feature/*"
   push:
     branches:
       - "*.x"
diff --git a/.github/workflows/composer-lint.yml b/.github/workflows/composer-lint.yml
index 24738f32..4c1dabd1 100644
--- a/.github/workflows/composer-lint.yml
+++ b/.github/workflows/composer-lint.yml
@@ -4,11 +4,13 @@ on:
   pull_request:
     branches:
       - "*.x"
+      - "feature/*"
     paths:
       - "composer.json"
   push:
     branches:
       - "*.x"
+      - "feature/*"
     paths:
       - "composer.json"
 
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 2dd408eb..d48d65fc 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -4,7 +4,7 @@ on:
   pull_request:
     branches:
       - "*.x"
-      - "master"
+      - "feature/*"
   push:
 
 env:
@@ -41,7 +41,7 @@ jobs:
           - dependencies: "lowest"
             os: "ubuntu-24.04"
             php-version: "8.1"
-            driver-version: "1.16.0"
+            driver-version: "1.21.0"
             stability: "stable"
             symfony-version: "6.4.*"
           - dependencies: "highest"
diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml
index 718750d9..49106d4d 100644
--- a/.github/workflows/static-analysis.yml
+++ b/.github/workflows/static-analysis.yml
@@ -4,6 +4,7 @@ on:
   pull_request:
     branches:
       - "*.x"
+      - "feature/*"
     paths:
       - .github/workflows/static-analysis.yml
       - composer.*
diff --git a/composer.json b/composer.json
index dbd735bb..8d1c4036 100644
--- a/composer.json
+++ b/composer.json
@@ -25,7 +25,7 @@
     "homepage": "http://www.doctrine-project.org",
     "require": {
         "php": "^8.1",
-        "ext-mongodb": "^1.16 || ^2",
+        "ext-mongodb": "^1.21 || ^2",
         "composer-runtime-api": "^2.0",
         "doctrine/mongodb-odm": "^2.6",
         "doctrine/persistence": "^3.0 || ^4.0",
diff --git a/config/command.php b/config/command.php
index 01e4e744..6b5af282 100644
--- a/config/command.php
+++ b/config/command.php
@@ -5,6 +5,8 @@
 use Doctrine\Bundle\MongoDBBundle\Command\ClearMetadataCacheDoctrineODMCommand;
 use Doctrine\Bundle\MongoDBBundle\Command\CreateSchemaDoctrineODMCommand;
 use Doctrine\Bundle\MongoDBBundle\Command\DropSchemaDoctrineODMCommand;
+use Doctrine\Bundle\MongoDBBundle\Command\Encryption\DiagnosticCommand;
+use Doctrine\Bundle\MongoDBBundle\Command\Encryption\DumpFieldsMapCommand;
 use Doctrine\Bundle\MongoDBBundle\Command\GenerateHydratorsDoctrineODMCommand;
 use Doctrine\Bundle\MongoDBBundle\Command\GenerateProxiesDoctrineODMCommand;
 use Doctrine\Bundle\MongoDBBundle\Command\InfoDoctrineODMCommand;
@@ -15,12 +17,21 @@
 use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
 
 use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
+use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_locator;
 
 return static function (ContainerConfigurator $containerConfigurator): void {
     $containerConfigurator->services()
         ->set('doctrine_mongodb.odm.command.clear_metadata_cache', ClearMetadataCacheDoctrineODMCommand::class)
             ->tag('console.command', ['command' => 'doctrine:mongodb:cache:clear-metadata'])
 
+        ->set('doctrine_mongodb.odm.command.encryption_diagnostic', DiagnosticCommand::class)
+            ->tag('console.command', ['command' => 'doctrine:mongodb:encryption:diagnostic'])
+            ->args([tagged_locator('doctrine_mongodb.connection_diagnostic', 'name')])
+
+        ->set('doctrine_mongodb.odm.command.encryption_dump_fields_map', DumpFieldsMapCommand::class)
+            ->tag('console.command', ['command' => 'doctrine:mongodb:encryption:dump-fields-map'])
+            ->args([tagged_locator('doctrine_mongodb.odm.document_manager', 'name')])
+
         ->set('doctrine_mongodb.odm.command.create_schema', CreateSchemaDoctrineODMCommand::class)
             ->tag('console.command', ['command' => 'doctrine:mongodb:schema:create'])
 
diff --git a/config/schema/mongodb-1.0.xsd b/config/schema/mongodb-1.0.xsd
index 4a63e8be..90588f99 100644
--- a/config/schema/mongodb-1.0.xsd
+++ b/config/schema/mongodb-1.0.xsd
@@ -9,7 +9,7 @@
 
   
     
-      
+      
       
       
       
@@ -46,8 +46,9 @@
 
   
     
-      
-      
+      
+      
+      
     
     
     
@@ -84,6 +85,9 @@
   
 
   
+    
+      
+    
     
   
 
@@ -119,12 +123,109 @@
     
   
 
+  
+    
+      
+      
+      
+      
+      
+      
+      
+    
+    
+    
+  
+
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+
+  
+    
+    
+    
+    
+  
+
+  
+    
+  
+
+  
+    
+    
+    
+    
+    
+  
+
+  
+    
+      
+    
+    
+    
+    
+    
+    
+  
+
   
     
       
       
-      
-      
+      
+      
     
     
     
@@ -167,10 +268,10 @@
 
   
     
-      
-      
-      
-      
+      
+      
+      
+      
     
     
     
diff --git a/docs/config.rst b/docs/config.rst
index d6aac188..59978e45 100644
--- a/docs/config.rst
+++ b/docs/config.rst
@@ -624,6 +624,10 @@ Otherwise you will get a *auth failed* exception.
                 ]);
         };
 
+Using Queryable Encryption
+--------------------------
+
+For details on configuring Queryable Encryption (QE) and Client-Side Field-Level Encryption (CSFLE), see :doc:`encryption`.
 
 Full Default Configuration
 --------------------------
@@ -699,6 +703,29 @@ Full Default Configuration
                         wTimeoutMS:                             ~
                     driver_options:
                         context:              ~ # stream context to use for connection
+                        autoEncryption:       # Options for client-side field-level encryption
+                            keyVaultClient:               null  # Service ID of a MongoDB\Driver\Manager for the key vault
+                            keyVaultNamespace:            null  # The namespace for the key vault collection (e.g., "encryption.__keyVault")
+                            kmsProvider:                  {}    # Configuration for Key Management System provider (see specific examples above)
+                                # e.g., { type: "local", key: "YOUR_BASE64_KEY" }
+                                # e.g., { type: "aws", accessKeyId: "...", secretAccessKey: "..." }
+                            masterKey:                    ~     # Default master key to use when creating a new encrypted collection
+                            schemaMap:                    []    # Document schemas for explicit encryption
+                            encryptedFieldsMap:           []    # Map of collections to their encrypted fields configuration
+                            extraOptions:                 []    # Extra options for mongocryptd
+                                # mongocryptdURI: "mongodb://localhost:27020"
+                                # mongocryptdBypassSpawn: false
+                                # mongocryptdSpawnPath: "/usr/local/bin/mongocryptd"
+                                # mongocryptdSpawnArgs: ["--idleShutdownTimeoutSecs=60"]
+                                # cryptSharedLibPath: null  # Path to the crypt_shared library
+                                # cryptSharedLibRequired: false # If true, fails if the crypt_shared library cannot be loaded
+                            bypassQueryAnalysis:          false # Disables automatic analysis of read and write operations for encryption
+                            bypassAutoEncryption:         false # Disables auto-encryption
+                            tlsOptions:                   # TLS options for the Key Vault client (if keyVaultClient is not specified)
+                                tlsCAFile:                              null  # Path to CA file, e.g., /path/to/key-vault-ca.pem
+                                tlsCertificateKeyFile:                  null  # Path to client cert/key file, e.g., /path/to/key-vault-client.pem
+                                tlsCertificateKeyFilePassword:          null  # Password for client cert/key file
+                                tlsDisableOCSPEndpointCheck:            false # Disable OCSP checks
 
             proxy_namespace:      MongoDBODMProxies
             proxy_dir:            "%kernel.cache_dir%/doctrine/odm/mongodb/Proxies"
@@ -825,8 +852,27 @@ Full Default Configuration
 
             $config->connection('id')
                 ->server('mongodb://localhost')
-                ->driverOptions([
-                    'context' => null, // stream context to use for connection
+                ->autoEncryption([ // Options for client-side field-level encryption
+                    'bypassAutoEncryption' => false, // Disables auto-encryption
+                    'keyVaultClient' => null,  // Service ID of a MongoDB\Driver\Manager for the key vault
+                    'keyVaultNamespace' => null,  // The namespace for the key vault collection (e.g., "encryption.__keyVault")
+                    'kmsProvider' => [    // Configuration for Key Management System provider
+                        // e.g., ['type' => 'local', 'key' => 'YOUR_BASE64_KEY']
+                        // e.g., ['type' => 'aws', 'accessKeyId' => '...', 'secretAccessKey' => '...']
+                    ],
+                    'schemaMap' => [],    // Document schemas for explicit encryption
+                    'encryptedFieldsMap' => [], // Map of collections to their encrypted fields configuration
+                    'extraOptions' => [    // Extra options for mongocryptd
+                        // 'cryptSharedLibPath' => null,  // Path to the crypt_shared library
+                        // 'cryptSharedLibRequired' => false, // If true, fails if the crypt_shared library cannot be loaded
+                    ],
+                    'bypassQueryAnalysis' => false, // Disables automatic analysis of read and write operations for encryption
+                    'tlsOptions' => [        // TLS options for the Key Vault client (if keyVaultClient is not specified)
+                        // 'tlsCAFile' => null,  // Path to CA file, e.g., /path/to/key-vault-ca.pem
+                        // 'tlsCertificateKeyFile' => null,  // Path to client cert/key file, e.g., /path/to/key-vault-client.pem
+                        // 'tlsCertificateKeyFilePassword' => null,  // Password for client cert/key file
+                        // 'tlsDisableOCSPEndpointCheck' => false, // Disable OCSP checks
+                    ],
                 ])
                 ->options([
                     'authMechanism' => null,
diff --git a/docs/encryption.rst b/docs/encryption.rst
new file mode 100644
index 00000000..3384db79
--- /dev/null
+++ b/docs/encryption.rst
@@ -0,0 +1,284 @@
+Client-Side Field-Level Encryption (CSFLE) and Queryable Encryption (QE)
+============================================================
+
+This page documents how to configure and use MongoDB Client-Side Field-Level Encryption (CSFLE) and Queryable Encryption (QE) in DoctrineMongoDBBundle.
+
+.. note::
+
+    CSFLE and QE are advanced MongoDB features that allow you to encrypt specific fields in your documents, with optional support for searching encrypted data (Queryable Encryption).
+
+Configuration
+-------------
+
+.. tip::
+
+    For a general overview of configuration options, see :doc:`config`.
+
+To enable CSFLE or QE, you need to configure the ``autoEncryption`` option under
+your connection's configuration. At a minimum, you must specify the ``kmsProvider``
+and the ``masterKey`` for KMS provider other than "local".
+Additional options are available for advanced use cases.
+
+.. configuration-block::
+
+    .. code-block:: yaml
+
+        doctrine_mongodb:
+            connections:
+                default:
+                    server: "mongodb://localhost:27017"
+                    autoEncryption:
+                        kmsProvider:
+                            local:
+                                key: "YOUR_BASE64_KEY"
+                        # Optional: see below for more options
+
+    .. code-block:: php
+
+        use Symfony\Config\DoctrineMongodbConfig;
+
+        return static function (DoctrineMongodbConfig $config): void {
+            $config->connection('default')
+                ->server('mongodb://localhost:27017')
+                ->autoEncryption([
+                    'kmsProvider' => [
+                        'type' => 'local',
+                        'key' => 'YOUR_BASE64_KEY',
+                    ],
+                    // ... other options ...
+                ]);
+        };
+
+Supported KMS Providers
+-----------------------
+
+The ``kmsProvider`` option specifies a single KMS provider that will be used for encryption.
+The type of KMS provider is specified with the ``type`` property along with its options.
+
+The configuration for each KMS provider varies and is described in the
+`MongoDB Manager constructor documentation `.
+
+Example of configuration for AWS
+
+
+.. code-block:: yaml
+
+    doctrine_mongodb:
+        connections:
+            default:
+                autoEncryption:
+                    kmsProvider:
+                        type: aws
+                        accessKeyId: YOUR_AWS_ACCESS_KEY_ID
+                        secretAccessKey: YOUR_AWS_SECRET_ACCESS_KEY
+                    masterKey:
+                        region: "eu-west-1"
+                        key: "arn:aws:kms:eu-west-1:123456789012:key/abcd1234-12ab-34cd-56ef-1234567890ab"
+
+
+Encrypted Fields Map
+--------------------
+
+The encrypted fields are set to the collection when you create it, and the MongoDB
+client will query the server for the collection schema before performing any
+operations. For additional security, you can also specify the encrypted fields
+in the connection configuration, which allows the client to use local rules
+instead of downloading the remote schema from the server, that could potentially
+be tampered with if an attacker compromises the server.
+
+The Encrypted Fields Map is a list of all encrypted fields associated with all
+the collection namespaces that has encryption enabled. To configure it, you
+can run a command that extract the encrypted fields from the server and generate
+the ``encryptedFieldsMap`` configuration.
+
+.. code-block:: console
+
+    php bin/console doctrine:mongodb:encryption:dump-fields-map --format yaml
+
+The output of the command will be a YAML configuration for the
+``autoEncryption.encryptedFieldsMap`` option in the connection configuration.
+
+- If the connection ``encryptedFieldsMap`` object contains a key for the specified
+  collection namespace, the client uses that object to perform automatic
+  Queryable Encryption, rather than using the remote schema. At minimum, the
+  local rules must encrypt all fields that the remote schema does.
+
+- If the connection ``encryptedFieldsMap`` object doesn't contain a key for the
+  specified collection namespace, the client downloads the server-side remote
+  schema for the collection and uses it instead.
+
+For more details, see the official MongoDB documentation:
+`Encrypted Fields and Enabled Queries `_.
+
+.. tabs::
+
+    .. group-tab:: YAML
+
+        .. code-block:: yaml
+
+            doctrine_mongodb:
+                connections:
+                    default:
+                        autoEncryption:
+                            encryptedFieldsMap:
+                                "mydatabase.mycollection":
+                                    fields:
+                                        - keyId: { $binary: { base64: 2CSosXLSTEKaYphcSnUuCw==, subType: '04' } }
+                                          path: "sensitive_field"
+                                          bsonType: "string"
+
+    .. group-tab:: XML
+
+        .. code-block:: xml
+
+            
+                
+                    
+                        
+                    
+                
+            
+
+    .. group-tab:: PHP
+
+        .. code-block:: php
+
+            use Symfony\Config\DoctrineMongodbConfig;
+
+            return static function (DoctrineMongodbConfig $config): void {
+                $config->connection('default')
+                    ->autoEncryption([
+                        'encryptedFieldsMap' => [
+                            'mydatabase.mycollection' => [
+                                'fields' => [
+                                    [
+                                        'path' => 'sensitive_field',
+                                        // Extended JSON representation of a BSON binary type
+                                        // The MongoDB\BSON\Binary class cannot be used here
+                                        'keyId' => ['$binary' => ['base64' => '2CSosXLSTEKaYphcSnUuCw==', 'subType' => '04' ] ],
+                                        'bsonType' => 'string',
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ]);
+            };
+
+Automatic Encryption Shared Library
+-----------------------------------
+
+To use automatic encryption, the MongoDB PHP driver requires the `Automatic Encryption Shared Library`_.
+
+If the driver is not able to find the library, you can specify its path using the ``cryptSharedLibPath`` extra option in your connection configuration.
+
+.. tabs::
+
+    .. group-tab:: YAML
+
+        .. code-block:: yaml
+
+            doctrine_mongodb:
+                connections:
+                    default:
+                        autoEncryption:
+                            extraOptions:
+                                cryptSharedLibPath: '%kernel.project_dir%/bin/mongo_crypt_v1.so'
+
+    .. group-tab:: XML
+
+        .. code-block:: xml
+
+            
+                
+                    
+                
+            
+
+    .. group-tab:: PHP
+
+        .. code-block:: php
+
+            use Symfony\Config\DoctrineMongodbConfig;
+
+            return static function (DoctrineMongodbConfig $config): void {
+                $config->connection('default')
+                    ->autoEncryption([
+                        'extraOptions' => [
+                            'cryptSharedLibPath' => '%kernel.project_dir%/bin/mongo_crypt_v1.so',
+                        ],
+                    ]);
+            };
+
+TLS Options
+-----------
+
+If you are not specifying a custom ``keyVaultClient`` service, you can configure
+TLS settings for the internal key vault client using the ``tlsOptions`` key:
+
+.. tabs::
+
+    .. group-tab:: YAML
+
+        .. code-block:: yaml
+
+            doctrine_mongodb:
+                connections:
+                    default:
+                        autoEncryption:
+                            tlsOptions:
+                                tlsCAFile: "/path/to/key-vault-ca.pem"
+                                tlsCertificateKeyFile: "/path/to/key-vault-client.pem"
+                                tlsCertificateKeyFilePassword: "keyvaultclientpassword"
+                                tlsDisableOCSPEndpointCheck: false
+
+    .. group-tab:: XML
+
+        .. code-block:: xml
+
+            
+                
+                    
+                
+            
+
+    .. group-tab:: PHP
+
+        .. code-block:: php
+
+            use Symfony\Config\DoctrineMongodbConfig;
+
+            return static function (DoctrineMongodbConfig $config): void {
+                $config->connection('default')
+                    ->autoEncryption([
+                        'tlsOptions' => [
+                            'tlsCAFile' => '/path/to/key-vault-ca.pem',
+                            'tlsCertificateKeyFile' => '/path/to/key-vault-client.pem',
+                            'tlsCertificateKeyFilePassword' => 'keyvaultclientpassword',
+                            'tlsDisableOCSPEndpointCheck' => false,
+                        ],
+                    ]);
+            };
+
+Further Reading
+---------------
+
+- `MongoDB CSFLE documentation `_
+- `MongoDB PHP driver Manager::__construct `_
+- :doc:`config`
+
+.. _`Automatic Encryption Shared Library`: https://www.mongodb.com/docs/manual/core/queryable-encryption/install-library/
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index c09c6edb..dfc9747d 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -36,12 +36,6 @@ parameters:
 			count: 1
 			path: src/CacheWarmer/ProxyCacheWarmer.php
 
-		-
-			message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\CacheWarmer\\ProxyCacheWarmer\:\:getClassesForProxyGeneration\(\) return type with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata does not specify its types\: T$#'
-			identifier: missingType.generics
-			count: 1
-			path: src/CacheWarmer/ProxyCacheWarmer.php
-
 		-
 			message: '#^Parameter \#1 \$application of static method Doctrine\\Bundle\\MongoDBBundle\\Command\\DoctrineODMCommand\:\:setApplicationDocumentManager\(\) expects Symfony\\Bundle\\FrameworkBundle\\Console\\Application, Symfony\\Component\\Console\\Application\|null given\.$#'
 			identifier: argument.type
@@ -102,6 +96,12 @@ parameters:
 			count: 1
 			path: src/Command/UpdateSchemaDoctrineODMCommand.php
 
+		-
+			message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DataCollector\\ConnectionDiagnostic\:\:__construct\(\) has parameter \$driverOptions with no value type specified in iterable type array\.$#'
+			identifier: missingType.iterableValue
+			count: 1
+			path: src/DataCollector/ConnectionDiagnostic.php
+
 		-
 			message: '#^Cannot cast array\|bool\|float\|int\|string\|UnitEnum\|null to string\.$#'
 			identifier: cast.string
@@ -222,6 +222,12 @@ parameters:
 			count: 1
 			path: src/DependencyInjection/DoctrineMongoDBExtension.php
 
+		-
+			message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:loadConnections\(\) has parameter \$config with no value type specified in iterable type array\.$#'
+			identifier: missingType.iterableValue
+			count: 1
+			path: src/DependencyInjection/DoctrineMongoDBExtension.php
+
 		-
 			message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\DoctrineMongoDBExtension\:\:loadConnections\(\) has parameter \$connections with no value type specified in iterable type array\.$#'
 			identifier: missingType.iterableValue
@@ -252,12 +258,6 @@ parameters:
 			count: 1
 			path: src/DependencyInjection/DoctrineMongoDBExtension.php
 
-		-
-			message: '#^PHPDoc tag @param references unknown parameter\: \$config$#'
-			identifier: parameter.notFound
-			count: 1
-			path: src/DependencyInjection/DoctrineMongoDBExtension.php
-
 		-
 			message: '#^Parameter \#2 \$bundles of method Symfony\\Bridge\\Doctrine\\DependencyInjection\\AbstractDoctrineExtension\:\:fixManagersAutoMappings\(\) expects array, array\|bool\|float\|int\|string\|UnitEnum\|null given\.$#'
 			identifier: argument.type
@@ -318,12 +318,6 @@ parameters:
 			count: 1
 			path: src/Form/ChoiceList/MongoDBQueryBuilderLoader.php
 
-		-
-			message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:getMetadata\(\) return type with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata does not specify its types\: T$#'
-			identifier: missingType.generics
-			count: 1
-			path: src/Form/DoctrineMongoDBTypeGuesser.php
-
 		-
 			message: '#^Method Doctrine\\Bundle\\MongoDBBundle\\Form\\DoctrineMongoDBTypeGuesser\:\:getMetadata\(\) should return array\{Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata, string\}\|null but returns array\{Doctrine\\Persistence\\Mapping\\ClassMetadata\