spring-projects/spring-data-mongodb
55.0
Adequate · 22 September 2026
124.9k
lines of production code
Java
primary language
7
measurements over time
What this system is
This system is the Spring Data MongoDB integration library, providing a comprehensive framework for accessing and manipulating MongoDB databases within Spring applications. It supports both synchronous and reactive programming models, offering features such as repository-based data access, complex aggregation pipelines, and client-side field-level encryption. The library also includes utilities for geospatial queries, file storage via GridFS, and real-time change stream monitoring, with dedicated support for Kotlin and native image compilation.
How it got here
2010–2011 — MongoDB integration modernization
35 changes.
This period focused on modernizing the Spring Data MongoDB integration by introducing new core abstractions, transaction management, and Java-based configuration classes. The work included refactoring bulk write and conversion subsystems, adding support for Atlas Vector Search and field-level encryption, and deprecating legacy map-reduce APIs in favor of the aggregation framework.
2012–2018 — Aggregation, Kotlin, and CDI expansion
26 changes.
This period focused on significantly expanding the MongoDB aggregation framework with extensive operator support and SpEL integration, while introducing Kotlin extensions for type-safe queries and reactive flows. It also added CDI support for repository injection, enhanced GridFS with fluent builders, and implemented new capabilities for GeoJSON, JSON Schema management, and Change Streams messaging.
2019–2023 — AOT support and field encryption
23 changes.
This period focused on enabling Ahead-of-Time (AOT) compilation for MongoDB repositories and lazy-loading proxies to support native image generation. It also introduced explicit client-side field-level encryption, allowing users to manage encryption keys and queryable encryption options directly via annotations. Additionally, the module migrated its CDI extension to Jakarta EE9 and deprecated its custom observability layer in favor of native driver support.
2024–2025 — Test coverage and benchmarking
5 changes.
This period focused on expanding test coverage for core MongoDB utilities, including driver version detection, JSON serialization, Kotlin data class handling, and pagination logic. It also introduced a suite of JMH microbenchmarks to measure the performance of projections, mapping, and repository operations, alongside tests for AOT-generated repository code.
Features
Add GeoJSON support with Jackson serialization and deserialization
This change introduces a complete set of GeoJSON model classes (Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, and GeometryCollection) in the \org.springframework.data.mongodb.core.geo\ package. It also adds a Jackson \Module\ (\GeoJsonModule\) that registers custom serializers and deserializers for these types, enabling seamless conversion between GeoJSON-formatted JSON and Spring Data MongoDB domain objects.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo · high confidence
Add explicit field encryption support
Introduces a new encryption conversion layer in the MongoDB module that enables explicit Client-Side Field Level Encryption (CSFLE). This change adds the \EncryptingConverter\ interface and its \MongoEncryptionConverter\ implementation, which handle encrypting and decrypting properties annotated with \@Encrypted\. It also includes \ExplicitEncryptionContext\ to bridge conversion contexts with encryption operations, allowing users to manage encryption keys and algorithms directly via annotations rather than relying solely on automatic driver-side decryption.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/encryption · high confidence
Added AOT support for MongoDB repositories
MongoDB repositories are now supported in Ahead-of-Time (AOT) compilation scenarios. This change introduces a new \aot.factories\ configuration file that registers runtime hints and bean registration processors, enabling proper native image generation for MongoDB data access components.
spring-data-mongodb/src/main/resources/META-INF/spring · high confidence
Added EncryptionUtils for resolving encryption key identifiers
A new internal utility class, EncryptionUtils, has been introduced to handle encryption-related tasks, specifically resolving plain string values into MongoDB's native keyId format. This utility supports resolving key identifiers from UUID strings or Base64-encoded data and can evaluate Spring Expression Language (SpEL) expressions to determine the keyId dynamically, facilitating the underlying support for explicit field encryption.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/encryption · high confidence
CDI integration for MongoDB repositories
This change introduces CDI (Contexts and Dependency Injection) support for Spring Data MongoDB repositories. It adds the \MongoRepositoryBean\ and \MongoRepositoryExtension\ classes, which allow MongoDB repositories to be discovered and exported as CDI beans within a Jakarta EE environment. Users can now inject MongoDB repositories directly into CDI-managed beans, leveraging the container's lifecycle and dependency injection capabilities.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/cdi · high confidence
Enable Ahead-of-Time (AOT) code generation for MongoDB repositories
This change introduces a new AOT repository contribution mechanism for Spring Data MongoDB, enabling the generation of repository implementations at build time rather than runtime. The \AotMongoRepositoryPostProcessor\ orchestrates this by registering type contributions and lazy-loading proxies, while a suite of new classes in the \aot\ package handles the specific code generation logic. \AotQueryCreator\ and \AotStringQuery\ parse and represent queries using placeholders for parameters, supporting derived queries, expressions, and vector search. \AggregationBlocks\ and \GeoBlocks\ generate the necessary code for aggregation pipelines and geospatial queries, respectively. \DeleteBlocks\ handles deletion logic, and \DocumentSerializer\ ensures proper JSON serialization of query objects with placeholders. This allows MongoDB repositories to be used in native images and other AOT environments without reflection-based proxy creation.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot · high confidence
Enable auto-configuration and XML namespace support for MongoDB repositories
The Spring Data MongoDB module now automatically registers the GeoJson configuration and the MongoRepositoryFactory via spring.factories, allowing repositories to be detected and configured without manual setup. Additionally, the module registers the MongoRepositoryConfigNamespaceHandler, enabling the use of the XML namespace for configuring MongoDB repositories, with schema definitions provided for versions 1.0 through 5.0.
spring-data-mongodb/src/main/resources/META-INF · high confidence
Enhanced MongoDB mapping with flexible field naming, encryption, and reference support
The mapping subsystem now supports storing document fields with literal dot characters in their names via the new FieldName abstraction and Field.nameType attribute, allowing dots to be treated as part of the key rather than path separators. It introduces the DocumentReference annotation for flexible, schema-independent entity linking with custom lookup queries, and adds the Encrypted and ExplicitEncrypted annotations to configure MongoDB Client Side Field Level Encryption at the type or field level. Additionally, the system now caches persistent property metadata for improved performance and provides a CollectionName abstraction to reduce duplication in collection name resolution.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping · high confidence
Expanded MongoDB Aggregation Framework support with new operators, stages, and expression capabilities
The aggregation API in the core module has been significantly extended to support a wide range of new MongoDB aggregation operators and stages, including $addFields, $merge, $unionWith, $vectorSearch, $setWindowFields, $densify, $graphLookup, $facet, $bucket, $bucketAuto, $sortByCount, $sample, $redact, $out, and $lookup (with let/pipeline support). New aggregation operators are now available for arithmetic, date, string, array, set, and evaluation operations (such as $expr, $cond, $ifNull, $function, $accumulator, and various trigonometric and statistical functions). The framework also introduces typed aggregation support, SpEL expression integration for projections, and enhanced field reference resolution within pipelines, allowing for more complex and type-safe data transformations directly in aggregation pipelines.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation · high confidence
Expanded SpEL-to-MongoDB aggregation operator support
The SpEL expression support in the MongoDB aggregation framework has been significantly extended to cover a wide range of MongoDB aggregation operators. This update adds mappings for mathematical functions (such as $acos, $acosh, $sin, $sinh, $cos, $cosh, $tan, $tanh, $atan, $atan2, $atanh), date/time operations ($dateAdd, $dateSubtract, $dateDiff, $dateTrunc, $dateFromParts), array manipulations ($sortArray, $firstN, $lastN, $minN, $maxN, $bottomN, $topN, $shift), and various other operators including $rank, $denseRank, $documentNumber, $rand, $derivative, $integral, $round, $getField, $setField, $locf, $tsIncrement, $tsSecond, $percentile, $median, $covariancePop, $covarianceSamp, $regexFind, $regexFindAll, $regexMatch, $replaceOne, and $replaceAll. Users can now leverage these operators directly within SpEL expressions in their aggregation pipelines.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel · high confidence
Introduce Change Streams support in MongoDB messaging
This release adds a new messaging abstraction for MongoDB Change Streams, allowing applications to subscribe to real-time data changes. The \spring-data-mongodb\ module now includes \ChangeStreamRequest\ and \ChangeStreamTask\ to handle event ingestion, supporting advanced options such as filtering, resuming via tokens or timestamps, and retrieving full documents or documents before change. The \DefaultMessageListenerContainer\ manages these long-running subscriptions, and the new \Message\ interface provides access to raw events and converted bodies, enabling seamless integration with existing Spring messaging patterns.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging · high confidence
Introduce explicit field encryption support with queryable encryption options
The encryption package now includes a new \Encryption\ interface and \MongoClientEncryption\ implementation that support explicit field-level encryption, including the ability to encrypt expressions. Users can now configure \EncryptionOptions\ with \QueryableEncryptionOptions\ to specify query types, contention factors, and range options (such as min, max, precision, sparsity, and trimFactor) for advanced queryable document encryption scenarios.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/encryption · high confidence
Kotlin extensions for MongoDB operations
This release adds Kotlin extension functions for the MongoDB template and reactive operations, allowing Kotlin developers to use reified type parameters for type-safe queries, aggregations, and CRUD operations without passing explicit Class objects. It also introduces Kotlin Coroutines Flow variants for reactive operations, enabling seamless integration with Kotlin's asynchronous programming model.
spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core · high confidence
MongoDB mapping events now expose the collection name
The \MongoMappingEvent\ base class now includes a \collectionName\ property, allowing event listeners and callbacks to identify which MongoDB collection triggered the event. This applies to all mapping events (such as \BeforeSaveEvent\, \AfterLoadEvent\, and \AfterConvertEvent\), enabling more granular handling of domain events across different collections.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event · high confidence
MongoDB repository configuration infrastructure and annotations
This change introduces the core configuration components for MongoDB repositories in Spring Data MongoDB. It adds the \@EnableMongoRepositories\ and \@EnableReactiveMongoRepositories\ annotations, allowing users to activate repository scanning for synchronous and reactive repositories respectively. The package includes the \MongoRepositoriesRegistrar\ and \ReactiveMongoRepositoriesRegistrar\ to wire up the configuration, along with \MongoRepositoryConfigurationExtension\ and \ReactiveMongoRepositoryConfigurationExtension\ to define how MongoDB repositories are detected and instantiated. Additionally, a \MongoRepositoryConfigNamespaceHandler\ is provided for XML-based configuration support, and an AOT processor (\AotMongoRepositoryPostProcessor\) is registered to support ahead-of-time compilation scenarios.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/config · high confidence
Native-image support for lazy-loading proxies and MongoDB driver types
This change adds Ahead-of-Time (AOT) processing support for Spring Data MongoDB, enabling proper functionality in native images. It introduces runtime hints that register JDK and CGLIB proxies for lazy-loaded DBRef and DocumentReference fields, ensuring that lazy loading works correctly when compiled to native code. Additionally, it provides reflection and proxy hints for MongoDB driver classes (such as MongoClientSettings, MongoDatabase, and MapReduceIterable) and entity callbacks (BeforeConvert, AfterSave, etc.), allowing these components to be accessed dynamically at runtime in a native image context.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/aot · high confidence
New JMH microbenchmarks for MongoDB projections, mapping, and repositories
Added a suite of JMH benchmarks in the \spring-data-mongodb/src/jmh\ module to measure performance characteristics of core MongoDB operations. The new benchmarks include \ProjectionsBenchmark\ for comparing read performance across domain types, DTOs, and closed/open projections; \DbRefMappingBenchmark\ for single and multiple DB reference loading; \MappingMongoConverterBenchmark\ for object-to-document conversion complexity; and \SmallerRepositoryBenchmark\ and \AotRepositoryBenchmark\ for repository factory bootstrap and query execution, including AOT-generated repository fragments. Benchmark results can be persisted to MongoDB or sent via HTTP using the new \MongoResultsWriter\ and \HttpResultsWriter\ infrastructure.
spring-data-mongodb/src/jmh · high confidence
New JavaConfig base classes for synchronous and reactive MongoDB setup
The configuration package now provides AbstractMongoClientConfiguration and AbstractReactiveMongoConfiguration as base classes for Java-based setup. AbstractMongoClientConfiguration registers beans for MongoClient, MongoDatabaseFactory, MongoTemplate, and MappingMongoConverter, allowing users to configure connection details via mongoClientSettings(). AbstractReactiveMongoConfiguration provides the reactive equivalent, registering ReactiveMongoDatabaseFactory, ReactiveMongoTemplate, and the corresponding converter. These classes simplify MongoDB integration by handling the standard bean wiring for both blocking and reactive drivers.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config · high confidence
New SpEL expression utility for MongoDB configuration
Added ExpressionUtils, a new internal utility class that detects and evaluates Spring Expression Language (SpEL) expressions within MongoDB configuration strings. This enables dynamic resolution of values (such as property placeholders) by parsing input strings and returning the evaluated result or the original literal if no expression is present.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/spel · high confidence
New core abstractions and transaction management infrastructure for MongoDB
This release introduces foundational classes for the MongoDB integration, including the \MongoDatabaseFactory\ interface and \MongoTransactionManager\ to enable Spring-managed client session transactions. It adds \SessionSynchronization\ support via \MongoDatabaseUtils\ to handle transactional database access, along with specific exception types like \ClientSessionException\ and \BulkOperationException\ to improve error handling for session and bulk write operations.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb · high confidence
New query and update builder implementations with enhanced collation and metadata support
The query module introduces \BasicQuery\ and \BasicUpdate\ as concrete implementations for constructing MongoDB queries and update operations from raw JSON strings or BSON Documents, providing a fluent API for programmatic query building. A new \Collation\ class is added to support MongoDB collation settings, allowing users to define locale-specific string comparison rules for queries and indexes. Additionally, the \Meta\ class now includes \DiskUse\ support to control whether temporary files can be written to disk during query execution, and \NearQuery\ is updated to support \ReadConcern\ and \ReadPreference\ for geo-spatial queries.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query · high confidence
New repository query annotations and updated repository interfaces
This release introduces several new annotations to the repository package to enhance query capabilities: @Aggregation for running aggregation pipelines directly on repository methods, @VectorSearch for Atlas Vector Search queries, @Update for declaring update operators, @Hint for index hints, @ReadPreference for read preference configuration, and specialized query annotations @CountQuery, @DeleteQuery, and @ExistsQuery. The MongoRepository and ReactiveMongoRepository interfaces have been adapted to extend List-based and ReactiveQueryByExampleExecutor interfaces respectively, and the @Meta annotation's allowDiskUse attribute now accepts a String to support MongoDB 4.2+ disk usage options.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository · high confidence
Support for JSON Schema generation and merging
The schema package now provides a comprehensive API for generating and managing MongoDB JSON schemas. Users can build schemas fluently using the new builder and property types (e.g., \string\, \object\, \number\), and merge multiple schema definitions into a single document using the new \MergedJsonSchema\ and \MergedJsonSchemaProperty\ classes, which handle conflict resolution via \TypeUnifyingMergeFunction\. The system also supports field-level encryption by including \encryptionMetadata\ in the generated schema document and allows defining query characteristics for encrypted fields through \QueryCharacteristic\ and \QueryCharacteristics\.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema · high confidence
Support for MongoDB Atlas Search indexes and collation on compound indexes
Users can now define and manage Atlas Search indexes using the new SearchIndexDefinition abstraction and DefaultSearchIndexOperations, enabling full-text search capabilities directly through Spring Data MongoDB. Additionally, the @CompoundIndex and @Indexed annotations now support a collation attribute, allowing language-specific string comparison rules to be applied to index creation.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index · high confidence
Support for ReadPreference annotations on repository methods
Users can now apply the @ReadPreference annotation to repository methods to control which MongoDB replica set members handle read operations. This is implemented via the new CrudMethodMetadata interface and CrudMethodMetadataPostProcessor, which inspect method annotations at runtime and bind the read preference to the current execution context, allowing fine-grained read routing without changing the underlying repository interface.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support · high confidence
Type-safe Kotlin extensions for MongoDB Criteria and Update APIs
New Kotlin extension functions have been added to the Spring Data MongoDB query module, enabling type-safe query building and document updates using Kotlin reflection. The \CriteriaExtensions.kt\ file provides idiomatic aliases for reserved keywords (such as \isEqualTo\ and \inValues\) and allows creating criteria chains using \KProperty\ references. The \TypedCriteriaExtensions.kt\ file introduces infix operators for standard MongoDB query operators (like \$lt\, \$gt\, \$in\, \$nin\) that accept \KProperty\ keys, while \TypedUpdateExtensions.kt\ adds similar type-safe extensions for update modifiers (such as \$set\, \$inc\, \$push\, \$pull\), allowing developers to write queries and updates with compile-time safety and improved readability.
spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query · high confidence
Removals
Removal of legacy MongoDB factory bean
The \MongoDbFactoryBean\ class, which previously provided a convenient Spring FactoryBean for configuring MongoDB connections, has been removed from the codebase. This change eliminates the legacy mechanism for instantiating MongoDB database connections via this specific bean, requiring users to adopt the new MongoDB abstractions being introduced in this release.
src/main/java · high confidence
Architecture
Added Sonargraph architecture definition for Spring Data MongoDB
This change introduces a new Sonargraph architecture description file (\Spring Data MongoDB.sonargraph\) that defines the module's internal structure, layers, and allowed dependencies. It establishes a layered architecture separating Repositories (with API, Query, and Implementation subsystems), Config, Monitoring, GridFS, and Core (with subsystems for Mapping, Geospatial, Query, Script, Conversion, SpEL, Aggregation, Index, MapReduce, and Util). It also defines external dependencies on Spring, Spring Data Core, the Mongo Java Driver, Querydsl, and Slf4j. This file is used for static architecture analysis to enforce dependency rules and prevent cyclic dependencies within the project.
spring-data-mongodb · high confidence
Behavioural changes
Deprecate Spring Data MongoDB observability in favor of native driver support
The observability infrastructure in the \org.springframework.data.mongodb.observability\ package—including the \ContextProviderFactory\, \MongoObservationCommandListener\, and related conventions—is now deprecated since version 5.1 and marked for removal. This change aligns with the MongoDB Java Driver 5.7+ which provides built-in observability via \ObservabilitySettings\. Users are advised to migrate to the driver's native observability solution rather than relying on the Micrometer-based instrumentation provided by Spring Data MongoDB.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/observability · high confidence
Documentation example symlink updated to point to Spring Data MongoDB
The documentation example entry in the Antora module has been converted into a symbolic link pointing to the Spring Data MongoDB example source code (spring-data-mongodb/src/test/java/org/springframework/data/mongodb/example). This change ensures that the documentation examples for this version are sourced directly from the Spring Data MongoDB test suite, aligning the published docs with the specific module's example implementations.
src/main/antora/modules/ROOT/examples · high confidence
GridFS API refactored with fluent upload builders and new query criteria helpers
The GridFS module introduces a fluent \GridFsUpload\ builder for storing files, allowing users to configure content, filename, metadata, and chunk size in a single chain. A new \GridFsCriteria\ helper class provides static methods to easily construct queries for filename, content type, and metadata. Additionally, \GridFsTemplate\ and \ReactiveGridFsTemplate\ now support \skip\ and \limit\ parameters in queries, and \GridFsResource\ exposes the underlying \GridFSFile\ for direct access to file metadata.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs · high confidence
Map-reduce API deprecated in favor of aggregation
The map-reduce support classes in the \org.springframework.data.mongodb.core.mapreduce\ package—including \MapReduceOptions\, \MapReduceResults\, \MapReduceCounts\, and \MapReduceTiming\—are now deprecated since version 3.4. Users should migrate to the aggregation framework (\org.springframework.data.mongodb.core.aggregation\) for data processing, as map-reduce is deprecated in MongoDB server version 5.0.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce · high confidence
Migrate build to Spring Develocity Conventions extension
The Maven build now uses the Spring Develocity Conventions extension (version 0.0.26) to standardize build behavior and connect to ge.spring.io. Additionally, the JVM configuration has been updated to include specific module exports and opens required by the compiler and related tools, ensuring compatibility with the new build conventions.
.mvn · high confidence
MongoDB CDI extension registration migrated to Jakarta EE9
The Spring Data MongoDB module now registers its CDI extension using the Jakarta EE9 namespace. A new service provider file at \META-INF/services/jakarta.enterprise.inject.spi.Extension\ declares \org.springframework.data.mongodb.repository.cdi.MongoRepositoryExtension\, ensuring that the MongoDB repository integration is correctly discovered by Jakarta-compatible CDI containers.
spring-data-mongodb/src/main/resources/META-INF/services · high confidence
New JSON parser with parameter binding and SpEL support
The \spring-data-mongodb/util/json\ package now includes a custom JSON parsing infrastructure (\ParameterBindingDocumentCodec\, \ParameterBindingJsonReader\, \JsonScanner\, etc.) that enables binding parameters and evaluating Spring Expression Language (SpEL) expressions directly within JSON strings used for queries and aggregations. This allows users to use placeholders (e.g., \?0\, \:\#{\#param}\) in JSON-based query definitions, which are resolved at runtime against provided values or the evaluation context, replacing the previous behavior where such dynamic binding was not supported in this JSON utility layer.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json · high confidence
New MongoDB utility classes for BSON handling and error mapping
The \spring.data.mongodb.util\ package now includes a suite of internal utility classes to improve BSON and driver interaction. \BsonUtils\ provides methods to convert \Bson\ objects to \Map\ or \Document\ formats, while \MongoClientVersion\ detects the MongoDB Java driver version (specifically checking for version 5+) to enable version-specific behavior. \MongoDbErrorCodes\ centralizes MongoDB error code mapping for better exception translation, and \SpringJsonWriter\ handles BSON-to-JSON serialization with placeholder support. Additional utilities include \DotPath\ for handling dotted field names, \DurationUtil\ for parsing duration expressions, \RegexFlags\ for translating regex flags, and \EmptyDocument\ for immutable empty document handling. \DBObjectUtils\ is marked as deprecated.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util · high confidence
Project repository restructured with new documentation and build tooling
The repository has been reorganized to improve developer onboarding and build consistency. New documentation files have been added, including a comprehensive README with Maven and Gradle setup instructions, a Security Policy, contribution guidelines, and a guide for running CI tasks locally using Docker. The legacy Eclipse project metadata files (.classpath and .project) have been removed in favor of modern build tooling, and the Maven Wrapper scripts (mvnw and mvnw.cmd) have been introduced to ensure reproducible builds. Additionally, the .gitignore file has been updated to exclude a wider range of IDE and build artifacts.
(repo-wide) · high confidence
Refactored MongoDB conversion and reference resolution subsystem
The mapping and conversion logic in the \core/convert\ package has been restructured to improve modularity and performance. A new \AbstractMongoConverter\ base class now centralizes the setup of the \ConversionService\ and basic type converters (such as \ObjectId\ and \Date\), while \DefaultMongoTypeMapper\ handles type hint storage using the \\_class\ field. Reference resolution has been decoupled into dedicated interfaces (\DbRefResolver\, \ReferenceResolver\) and implementations (\DefaultDbRefResolver\, \DefaultReferenceResolver\) that support both legacy \DBRef\ and newer \DocumentReference\ associations, including lazy-loading proxies. Additionally, a new \DocumentAccessor\ wrapper standardizes raw value access for \Document\ and \DBObject\ types, and \DefaultDbRefProxyHandler\ manages ID population for lazy-loading proxies.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert · high confidence
Refactored bulk write operations to support multi-collection writes and aggregation pipelines
The bulk write implementation in MongoTemplate has been refactored to decouple the bulk execution logic from the template itself, introducing new internal classes (BulkWriter, BulkWriteSupport, BulkOperationsSupport) to handle write model creation and execution. This change enables bulk operations to span multiple collections in a single request by utilizing the MongoDB driver's client-level bulk write API (ClientBulkWriteResult) when operations target different namespaces, while falling back to collection-level bulk writes for single-collection scenarios. Additionally, the refactoring adds support for using aggregation pipelines as update definitions within bulk operations (AggregationUpdate), allowing complex update logic to be applied in batch writes.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core · high confidence
Removed Eclipse JDT core settings file
The .settings/org.eclipse.jdt.core.prefs file, which previously configured the Java compiler to target source, compliance, and target platforms of version 1.5, has been deleted from the project. This removes the explicit Eclipse-specific Java 1.5 compiler settings.
.settings · high confidence
Repository query execution refactored to use the fluent Executable API
The repository query execution mechanism has been refactored to use the new fluent Executable API (e.g., \ExecutableFindOperation\, \ExecutableUpdateOperation\) instead of the legacy \MongoTemplate\-based approach. This change introduces new base classes (\AbstractMongoQuery\, \AbstractReactiveMongoQuery\) that handle query execution, parameter binding, and metadata application (such as collation, hints, and read preferences) through the fluent operations API, providing a more consistent and performant foundation for both synchronous and reactive repository queries.
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query · high confidence
Updated XML namespace schemas for Spring Data MongoDB
The XML configuration schemas (XSDs) for Spring Data MongoDB have been updated across versions 1.0 through 1.5. These changes include the introduction of the \mongo-client\ element to replace the deprecated \mongo\ element, the addition of the \authentication-dbname\ attribute to the \db-factory\ element to support login via a different authentication database, and the addition of the \type-mapper-ref\ attribute to the \mapping-converter\ element to improve configurability of the TypeMapper. Additionally, the \id\ attribute on \db-factory\ and \mapping-converter\ elements has been changed from \xsd:ID\ to \xsd:string\, and the \create-query-indexes\ attribute in repository configurations now accepts string values in addition to booleans.
spring-data-mongodb/src/main/resources/org · high confidence
Test coverage
Add test utility for aggregation context; Added CDI integration tests for MongoDB repositories; Added Kotlin extension tests for Spring Data MongoDB core operations; Added Kotlin unit tests for Criteria and Update extensions; Added XML configuration and properties for repository integration tests; Added XML namespace configuration tests for MongoDB client and factory beans; Added example code for MongoDB integration; Added integration tests for custom and composed repository implementations; Added performance benchmark tests for MongoDB access layers; Added test coverage for AOT-generated MongoDB repository code; Added test coverage for configuration classes in the default package; Added test fixtures and unit tests for MongoDB mapping subsystem; Added test fixtures for AOT repository support; Added test resources for Spring Data MongoDB; Added test resources for named query externalization; Added tests for Map-Reduce operations in MongoTemplate and ReactiveMongoTemplate; Added tests for MappingMongoConverter Kotlin support; Added tests for MongoDB AOT repository contributions; Added tests for MongoDB Change Streams and Tailable Cursors; Added tests for MongoDB client-side encryption features; Added tests for MongoDB configuration and auditing support; Added tests for MongoDB mapping event lifecycle and entity callbacks; Added tests for MongoDB observability integration; Added tests for MongoDB repository configuration and registration; Added tests for auditing immutable versioned entities; Added tests for declarative MongoDB transaction options and session management; Added tests for geospatial queries and GeoJSON serialization; Added tests for nested MongoDB repository configuration; Added unit and integration tests for GridFS components; Added unit and integration tests for JSON Schema generation and validation; Added unit and integration tests for MongoDB index handling; Added unit tests for AOT proxy and runtime hint processing; Added unit tests for BsonUtils and ParameterBindingJsonReader; Added unit tests for Kotlin coroutine repository query methods; Added unit tests for Kotlin repository support; Added unit tests for MongoDB conversion components; Added unit tests for MongoDB driver version detection and JSON serialization utilities; Added unit tests for MongoDB repository query execution and parameter handling; Added unit tests for MongoDB repository support classes; Added unit tests for SliceUtils pagination logic; Added unit tests for aggregation operators and operations; Expanded test coverage for MongoDB query and update APIs; Expanded test coverage for MongoDB repository query capabilities; Expanded test coverage for Spring Data MongoDB core operations; New test utilities and infrastructure for MongoDB integration testing.
Dependencies
Upgrade Maven Wrapper to version 3.9.16
The Maven Wrapper configuration has been updated to use Maven distribution version 3.9.16. This ensures that builds executed via the wrapper will utilize this specific Maven release, providing consistency across development and CI environments.
.mvn/wrapper · high confidence
Upgrade to MongoDB Java Driver 5.11.1 and migrate to Antora documentation
The Spring Data MongoDB distribution now targets MongoDB Java Driver version 5.11.1, bringing support for the latest driver features and improvements. Additionally, the project has migrated its reference documentation build system to Antora, introducing a new distribution module that manages Antora and related extensions (such as @springio/antora-extensions and @asciidoctor/tabs) to generate the documentation site.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 60 → 55 (-5.4)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 78 → 86 (+8.8)
- Architecture 99 → 73 (-26.1)
- Maturity 53 → 50 (-3.7)
- Readiness 57 → 61 (+4.0)
- Security 70 → 51 (-18.7)
Resolved (85)
- Change coupling: AggregationBlocks.java ↔ MongoRepositoryContributor.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AggregationBlocks.java)
- Change coupling: AggregationBlocks.java ↔ QueryBlocks.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AggregationBlocks.java)
- Change coupling: ContextProviderFactory.java ↔ MongoObservationCommandListener.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/observability/ContextProviderFactory.java)
- Change coupling: MongoAotRepositoryFragmentSupport.java ↔ MongoCodeBlocks.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/MongoAotRepositoryFragmentSupport.java)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/BulkWriter.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableUpdateOperationSupport.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/MongoAotRepositoryFragmentSupport.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java)
- Duplicated block (10 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleMongoRepository.java)
- Duplicated block (11 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java)
- Duplicated block (11 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java)
- Duplicated block (11 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/BucketOperationSupport.java)
- Duplicated block (11 lines × 2) (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/GeoConverters.java)
- …and 65 more
New (862)
- Change coupling: AggregationOperationRenderer.java ↔ ExposedFieldsAggregationOperationContext.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationRenderer.java)
- Change coupling: CompoundIndex.java ↔ Indexed.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/CompoundIndex.java)
- Change coupling: ConvertingParameterAccessor.java ↔ MongoParametersParameterAccessor.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ConvertingParameterAccessor.java)
- Change coupling: ExecutableRemoveOperation.java ↔ ExecutableUpdateOperation.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableRemoveOperation.java)
- Change coupling: GeospatialIndex.java ↔ Index.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/GeospatialIndex.java)
- Change coupling: MappingMongoConverter.java ↔ CachingMongoPersistentProperty.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java)
- Change coupling: MappingMongoConverter.java ↔ UnwrappedMongoPersistentProperty.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java)
- Change coupling: MongoParameters.java ↔ MongoQueryCreator.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoParameters.java)
- Change coupling: ReactiveMongoTemplate.java ↔ ChangeStreamTask.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java)
- Change coupling: SimpleMongoRepository.java ↔ SimpleReactiveMongoRepository.java (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleMongoRepository.java)
- ClassTooLong: ArithmeticOperators (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArithmeticOperators.java)
- ClassTooLong: ArrayOperators (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ArrayOperators.java)
- ClassTooLong: Criteria (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Criteria.java)
- ClassTooLong: DateOperators (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/DateOperators.java)
- ClassTooLong: EntityOperations (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java)
- ClassTooLong: IdentifiableJsonSchemaProperty (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/IdentifiableJsonSchemaProperty.java)
- ClassTooLong: JsonScanner (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/JsonScanner.java)
- ClassTooLong: MappingMongoConverter (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java)
- ClassTooLong: ParameterBindingJsonReader (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/ParameterBindingJsonReader.java)
- ClassTooLong: ProjectionOperation (spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java)
- …and 842 more
Changes since last survey
- 18 commits — 18 feature/other, 0 fixes
By area
- spring-data-mongodb/src — 7 commits
- (root) — 6 commits
- (repo) — 2 commits
- .github/workflows — 1 commit
- .mvn/extensions.xml — 1 commit
- src/main — 1 commit
Notable commits
- change: Adapt to changes in Spring Framework.
- change: Add missing proxy hints for the reactive MongoDB driver.
- change: Add missing tests for sync driver proxy hints.
- change: Add release train automation.
- change: Enter rampdown phase for 5.2.0-M1.
- change: Enter rampdown phase for 5.2.0-M2.
- change: Polishing.
- change: Prepare next development iteration.
- change: Release version 5.2.0-M1 (2026.1.0).
- change: Remove locking in CursorReadingTask.getState()
- change: Remove redundant assertion in EncryptionOptions constructor
- change: Support Set return types in MongoDB AOT repositories.
- change: Update Maven extensions.
- change: Update build config for correct notice and license.txt inclusion.
- change: Upgrade to MongoDB 5.11.0.
- change: Upgrade to MongoDB 5.11.1.
- change: Upgrade to MongoDB 5.9.1.
- change: Upgrade to MongoDB 5.9.2
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
spring-projects/spring-data-mongodb was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 22 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 486b674d7a3409ac62dbcdd53d0f9a4e7b29bdae — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-90d5d2fe38ee.