spring-projects/spring-data-mongodbGitHubLast refreshed Oct 3, 2026
This is a public, read-only report. Striff reads this repository's docs, turns each sentence that makes a claim about the code into a rule, and checks the rule against the code on the default branch. How this works
Names these docs write that the code no longer has1
Each sentence below names a type the default branch doesn't declare, or declares somewhere else. Edit the doc so it matches the code, or bring the type back.
The first argument is the name of the collection to run the group operation over, the second is a fluent API that specifies properties of the group operation via a GroupBy class.
org.springframework.data.mongodb.core.mapreduce declares nothing by this name.
+ The actual aggregate operation is run by the aggregate method of the MongoTemplate, which takes the desired output class as a parameter.
MongoTemplate has an aggregate method
Holds
Read Oct 3
The projection can be extended with additional fields through a fluent API by using the and(String) method and aliased by using the as(String) method.
ProjectionOperation has an and method
Holds
Read Oct 3
To create output fields in buckets, bucket operations can use AggregationExpression through andOutput() and xref:mongodb/aggregation-framework.adoc#mongo.aggregation.projection.expressions[SpEL expressions] through andOutputExpression().
BucketOperation has an andOutput method
Holds
Read Oct 3
To create output fields in buckets, bucket operations can use AggregationExpression through andOutput() and xref:mongodb/aggregation-framework.adoc#mongo.aggregation.projection.expressions[SpEL expressions] through andOutputExpression().
BucketOperation has an andOutputExpression method
Holds
Read Oct 3
To create output fields in buckets, bucket operations can use AggregationExpression through andOutput() and xref:mongodb/aggregation-framework.adoc#mongo.aggregation.projection.expressions[SpEL expressions] through andOutputExpression().
BucketAutoOperation has an andOutput method
Holds
Read Oct 3
To create output fields in buckets, bucket operations can use AggregationExpression through andOutput() and xref:mongodb/aggregation-framework.adoc#mongo.aggregation.projection.expressions[SpEL expressions] through andOutputExpression().
BucketAutoOperation has an andOutputExpression method
Holds
Read Oct 3
You can customize it with multiple aggregation pipelines by using the and() method.
FacetOperation has an and method
Holds
Read Oct 3
We support the use of SpEL expressions in projection expressions through the andExpression method of the ProjectionOperation and BucketOperation classes.
ProjectionOperation has an andExpression method
Holds
Read Oct 3
Methods such as (Reactive)MongoOperations#getCollection return native MongoDB Java Driver gateway objects (such as MongoCollection) that themselves offer dedicated methods for ClientSession.
MongoOperations has a getCollection method
Holds
Read Oct 3
Methods such as (Reactive)MongoOperations#getCollection return native MongoDB Java Driver gateway objects (such as MongoCollection) that themselves offer dedicated methods for ClientSession.
ReactiveMongoOperations has a getCollection method
Holds
Read Oct 3
Nevertheless, one may override MongoTransactionManager#doCommit(MongoTransactionObject) to implement a https://docs.mongodb.com/manual/core/transactions/#retry-commit-operation[Retry Commit Operation] behavior as outlined in the MongoDB reference manual.
MongoTransactionManager has a doCommit method
Holds
Read Oct 3
Once MongoTemplate detects an active transaction, all exposed count() methods are converted and delegated to the aggregation framework using $match and $count operators, preserving Query settings, such as collation.
MongoTemplate has a count method
Holds
Read Oct 3
Queries using Criteria.near(…) and Criteria.nearSphere(…) must be rewritten to Criteria.within(…) respective Criteria.withinSphere(…).
Criteria has a near method
Holds
Read Oct 3
Queries using Criteria.near(…) and Criteria.nearSphere(…) must be rewritten to Criteria.within(…) respective Criteria.withinSphere(…).
Criteria has a nearSphere method
Holds
Read Oct 3
Queries using Criteria.near(…) and Criteria.nearSphere(…) must be rewritten to Criteria.within(…) respective Criteria.withinSphere(…).
Criteria has a within method
Holds
Read Oct 3
Queries using Criteria.near(…) and Criteria.nearSphere(…) must be rewritten to Criteria.within(…) respective Criteria.withinSphere(…).
Criteria has a withinSphere method
Holds
Read Oct 3
To intercept an object before it goes through the conversion process (which turns your domain object into a org.bson.Document), you can register a subclass of AbstractMongoEventListener that overrides the onBeforeConvert method.
AbstractMongoEventListener has an onBeforeConvert method
Holds
Read Oct 3
To intercept an object before it goes into the database, you can register a subclass of javadoc:org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener[] that overrides the onBeforeSave method.
AbstractMongoEventListener has an onBeforeSave method
Holds
Read Oct 3
Called in MongoTemplateinsert, insertList, and save operations before the object is converted to a Document by a MongoConverter.
MongoTemplate depends on MongoConverter
Holds
Read Oct 3
Use a static import of JsonSchemaProperty to make the syntax slightly more compact and to get entry points such as string(…).
JsonSchemaProperty has a string method
Holds
Read Oct 3
MongoJsonSchemaCreator.property(…) allows defining additional details such as nested document types that should be considered when rendering the schema.
MongoJsonSchemaCreator has a property method
Holds
Read Oct 3
Unless explicitly configured, an instance of MappingMongoConverter is created by default when you create a MongoTemplate.
MongoTemplate depends on MappingMongoConverter
Holds
Read Oct 3
MongoDB's native JSR-310 support can be enabled through MongoConverterConfigurationAdapter.useNativeDriverJavaTimeCodecs().
MongoConverterConfigurationAdapter has an useNativeDriverJavaTimeCodecs method
Holds
Read Oct 3
AbstractMongoClientConfiguration creates a MongoTemplate instance and registers it with the container under the name mongoTemplate.
AbstractMongoClientConfiguration depends on MongoTemplate
Holds
Read Oct 3
+ Using a MappingMongoConverter#setMapKeyDotReplacement allowed circumvent some of the limitations when storing Map structures by substituting dots on write with another character.
MappingMongoConverter has setMapKeyDotReplacement
Holds
Read Oct 3
+ To allow dots in Map structures please set preserveMapKeys on the MappingMongoConverter.
MappingMongoConverter has preserveMapKeys
Holds
Read Oct 3
The EncryptionKeyResolver uses an EncryptionContext providing access to the property allowing for dynamic DEK resolution.
EncryptionKeyResolver depends on EncryptionContext
Holds
Read Oct 3
SearchIndexOperationsProvider implemented by MongoTemplate are the entrypoint to SearchIndexOperations offering various methods for managing vector indexes.
SearchIndexOperationsProvider implemented by MongoTemplate are the entrypoint to SearchIndexOperations offering various methods for managing vector indexes.
SearchIndexOperationsProvider depends on SearchIndexOperations
Holds
Read Oct 3
The actual status of a search index can be obtained via SearchIndexOperations#status(...).
SearchIndexOperations has a status method
Holds
Read Oct 3
Capped collections can be created with MongoOperations.createCollection.
MongoOperations has createCollection
Holds
Read Oct 3
The Message#getBody() is converted to the requested domain type.
Message has a getBody method
Holds
Read Oct 3
The javadoc:org.springframework.data.mongodb.core.MongoTemplate[] and its javadoc:org.springframework.data.mongodb.core.ReactiveMongoTemplate[reactive] counterpart class, located in the org.springframework.data.mongodb.core package, is the central class of Spring's MongoDB support and provides a rich feature set for interacting with the database.
MongoTemplate is in org.springframework.data.mongodb.core
Holds
Read Oct 3
The javadoc:org.springframework.data.mongodb.core.MongoTemplate[] and its javadoc:org.springframework.data.mongodb.core.ReactiveMongoTemplate[reactive] counterpart class, located in the org.springframework.data.mongodb.core package, is the central class of Spring's MongoDB support and provides a rich feature set for interacting with the database.
ReactiveMongoTemplate is in org.springframework.data.mongodb.core
Holds
Read Oct 3
The javadoc:org.springframework.data.mongodb.core.MongoTemplate[] class implements the interface javadoc:org.springframework.data.mongodb.core.MongoOperations[].
MongoTemplate implements MongoOperations
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has a find method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has a findAndModify method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has a findAndReplace method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has a findOne method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has an insert method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has a remove method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has a save method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has an update method
Holds
Read Oct 3
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
MongoOperations has an updateMulti method
Holds
Read Oct 3
<T> T *execute* (Class<?> entityClass, CollectionCallback<T> action): Runs the given CollectionCallback for the entity collection of the specified class.
MongoTemplate has execute
Holds
Read Oct 3
The entry points (insert(…), find(…), update(…), and others) follow a natural naming schema based on the operation to be run.
FluentMongoOperations has an insert method
Holds
Read Oct 3
The entry points (insert(…), find(…), update(…), and others) follow a natural naming schema based on the operation to be run.
FluentMongoOperations has an update method
Holds
Read Oct 3
You can access these operations by calling the indexOps method and passing in either the collection name or the java.lang.Class of your entity (the collection name is derived from the .class, either by name or from annotation metadata).
MongoTemplate has an indexOps method
Holds
Read Oct 3
The IndexOperations interface has the getIndexInfo method that returns a list of IndexInfo objects.
IndexOperations has a getIndexInfo method
Holds
Read Oct 3
The IndexOperations interface has the getIndexInfo method that returns a list of IndexInfo objects.
IndexOperations depends on IndexInfo
Holds
Read Oct 3
You can use the @TimeSeries#expireAfter option to have MongoDB automatically remove expired buckets.
TimeSeries has expireAfter
Holds
Read Oct 3
By setting MongoTemplate#useEstimatedCount(...) to true _MongoTemplate#count(...)_ operations, that use an empty filter query, will be delegated to estimatedCount, as long as there is no transaction active and the template is not bound to a xref:mongodb/client-session-transactions.adoc[session].
MongoTemplate has an useEstimatedCount method
Holds
Read Oct 3
void *save* (Object objectToSave): Save the object to the default collection.
MongoTemplate has save
Holds
Read Oct 3
void *insert* (Object objectToSave): Insert the object to the default collection.
MongoTemplate has insert
Holds
Read Oct 3
For updates, you can update the first document found by using MongoOperations.updateFirst or you can update all documents that were found to match the query by using the MongoOperations.updateMulti method or all on the fluent API.
MongoOperations has an updateFirst method
Holds
Read Oct 3
For updates, you can update the first document found by using MongoOperations.updateFirst or you can update all documents that were found to match the query by using the MongoOperations.updateMulti method or all on the fluent API.
MongoTemplate provides four findAndModify overloaded methods that take Query and Update classes and converts from Document to your POJOs:
MongoTemplate has a findAndModify method
Holds
Read Oct 3
<1> Use the fluent update API with the domain type given for mapping the query and deriving the collection name or just use MongoOperations#findAndReplace.
MongoOperations has findAndReplace
Holds
Read Oct 3
To remove a Document without version check use MongoOperations#remove(Query,...) instead of MongoOperations#remove(Object).
MongoOperations has remove
Holds
Read Oct 3
Spring Data MongoDB provides a javadoc:org.springframework.data.mongodb.gridfs.GridFsOperations[] and javadoc:org.springframework.data.mongodb.gridfs.ReactiveGridFsOperations[] interface as well as the corresponding implementation, GridFsTemplate and ReactiveGridFsTemplate, to let you interact with the filesystem.
GridFsTemplate implements GridFsOperations
Holds
Read Oct 3
Spring Data MongoDB provides a javadoc:org.springframework.data.mongodb.gridfs.GridFsOperations[] and javadoc:org.springframework.data.mongodb.gridfs.ReactiveGridFsOperations[] interface as well as the corresponding implementation, GridFsTemplate and ReactiveGridFsTemplate, to let you interact with the filesystem.
Spring Data MongoDB provides a javadoc:org.springframework.data.mongodb.gridfs.GridFsOperations[] and javadoc:org.springframework.data.mongodb.gridfs.ReactiveGridFsOperations[] interface as well as the corresponding implementation, GridFsTemplate and ReactiveGridFsTemplate, to let you interact with the filesystem.
GridFsOperations is a contract
Holds
Read Oct 3
Spring Data MongoDB provides a javadoc:org.springframework.data.mongodb.gridfs.GridFsOperations[] and javadoc:org.springframework.data.mongodb.gridfs.ReactiveGridFsOperations[] interface as well as the corresponding implementation, GridFsTemplate and ReactiveGridFsTemplate, to let you interact with the filesystem.
ReactiveGridFsOperations is a contract
Holds
Read Oct 3
The store(…) operations take an InputStream, a filename, and (optionally) metadata information about the file to store.
GridFsOperations has a store method
Holds
Read Oct 3
The metadata can be an arbitrary object, which will be marshaled by the MongoConverter configured with the GridFsTemplate.
GridFsTemplate depends on MongoConverter
Holds
Read Oct 3
The store(…) operations take an Publisher<DataBuffer>, a filename, and (optionally) metadata information about the file to store.
ReactiveGridFsOperations has a store method
Holds
Read Oct 3
The metadata can be an arbitrary object, which will be marshaled by the MongoConverter configured with the ReactiveGridFsTemplate.
ReactiveGridFsTemplate depends on MongoConverter
Holds
Read Oct 3
You can read files from the filesystem through either the find(…) or the getResources(…) methods.
GridFsOperations has a find method
Holds
Read Oct 3
You can read files from the filesystem through either the find(…) or the getResources(…) methods.
GridFsOperations has a getResources method
Holds
Read Oct 3
It provides static factory methods to encapsulate default metadata fields (such as whereFilename() and whereContentType()) or a custom one through whereMetaData().
GridFsCriteria has a whereFilename method
Holds
Read Oct 3
It provides static factory methods to encapsulate default metadata fields (such as whereFilename() and whereContentType()) or a custom one through whereMetaData().
GridFsCriteria has a whereContentType method
Holds
Read Oct 3
It provides static factory methods to encapsulate default metadata fields (such as whereFilename() and whereContentType()) or a custom one through whereMetaData().
GridFsCriteria has a whereMetaData method
Holds
Read Oct 3
Earlier, we saw how to retrieve a single document by using the findOne and findById methods on MongoTemplate.
MongoTemplate has a findOne method
Holds
Read Oct 3
Earlier, we saw how to retrieve a single document by using the findOne and findById methods on MongoTemplate.
MongoTemplate has a findById method
Holds
Read Oct 3
The criteria are specified by using a Criteria object that has a static factory method named where to instantiate a new Criteria object.
Criteria has a where method
Holds
Read Oct 3
To let you do so, MongoOperations provides geoNear(…) methods that take a NearQuery as an argument (as well as the already familiar entity type and collection), as shown in the following example:
MongoOperations has a geoNear method
Holds
Read Oct 3
The org.springframework.data.mongodb.core.geo package contains types such as GeoJsonPoint, GeoJsonPolygon, and others.
GeoJsonPoint is in org.springframework.data.mongodb.core.geo
Holds
Read Oct 3
The org.springframework.data.mongodb.core.geo package contains types such as GeoJsonPoint, GeoJsonPolygon, and others.
GeoJsonPolygon is in org.springframework.data.mongodb.core.geo
Holds
Read Oct 3
To sort results by relevance according to the weights use TextQuery.sortByScore.
TextQuery has sortByScore
Holds
Read Oct 3
<2> Use TextQuery.includeScore() to include the calculated relevance in the resulting Document.
TextQuery has an includeScore method
Holds
Read Oct 3
TextCriteria.matching takes the provided term as is.
TextCriteria has matching
Holds
84 rules from 14 docs
See these where the change is. The browser extension puts a pull request's doc findings, and a diagram of what it changed, on the GitHub page itself, so the code and what your docs say about it are side by side.