Docs & rules

spring-projects/spring-data-mongodbGitHub

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

1 stale name in these docs.

main34eb60eLast read Oct 3

Is this yours? Install to manage it

Once installed, Striff checks every pull request.

Rules summary
Documents
Rules
83
83
83
83
83
83
83
83
6
1
5
8
8
3
1
1 stale name
3
2
15
4
1
10
13
9
25 docs
spring-projects/spring-data-mongodbOpen repository

Stale names in these docs1

Each sentence below has a stale name: 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.

  • Goneorg.springframework.data.mongodb.core.mapreduce.GroupBy
    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.

    View on GitHub

spring-projects/spring-data-mongodb — documented rules

83 of 83 rules, printed November 17, 2026.

The sentence in your docs
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
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
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().
4 rules from this sentence
BucketOperation has an andOutput method
Holds
BucketOperation has an andOutputExpression method
Holds
BucketAutoOperation has an andOutput method
Holds
BucketAutoOperation has an andOutputExpression method
Holds
You can customize it with multiple aggregation pipelines by using the and() method.
FacetOperation has an and method
Holds
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
Methods such as (Reactive)MongoOperations#getCollection return native MongoDB Java Driver gateway objects (such as MongoCollection) that themselves offer dedicated methods for ClientSession.
2 rules from this sentence
ReactiveMongoOperations has a getCollection method
Holds
MongoOperations has a getCollection method
Holds
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
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
Queries using Criteria.near(…) and Criteria.nearSphere(…) must be rewritten to Criteria.within(…) respective Criteria.withinSphere(…).
4 rules from this sentence
Criteria has a near method
Holds
Criteria has a nearSphere method
Holds
Criteria has a within method
Holds
Criteria has a withinSphere method
Holds
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
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
Called in MongoTemplate insert, insertList, and save operations before the object is converted to a Document by a MongoConverter.
MongoTemplate depends on MongoConverter
Holds
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
Unless explicitly configured, an instance of MappingMongoConverter is created by default when you create a MongoTemplate.
MongoTemplate depends on MappingMongoConverter
Holds
MongoDB's native JSR-310 support can be enabled through MongoConverterConfigurationAdapter.useNativeDriverJavaTimeCodecs().
MongoConverterConfigurationAdapter has an useNativeDriverJavaTimeCodecs method
Holds
AbstractMongoClientConfiguration creates a MongoTemplate instance and registers it with the container under the name mongoTemplate.
AbstractMongoClientConfiguration depends on MongoTemplate
Holds
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
To allow dots in Map structures please set preserveMapKeys on the MappingMongoConverter.
MappingMongoConverter has preserveMapKeys
Holds
The EncryptionKeyResolver uses an EncryptionContext providing access to the property allowing for dynamic DEK resolution.
EncryptionKeyResolver depends on EncryptionContext
Holds
SearchIndexOperationsProvider implemented by MongoTemplate are the entrypoint to SearchIndexOperations offering various methods for managing vector indexes.
2 rules from this sentence
MongoTemplate implements SearchIndexOperationsProvider
Holds
SearchIndexOperationsProvider depends on SearchIndexOperations
Holds
The actual status of a search index can be obtained via SearchIndexOperations#status(...).
SearchIndexOperations has a status method
Holds
Capped collections can be created with MongoOperations.createCollection.
MongoOperations has createCollection
Holds
The Message#getBody() is converted to the requested domain type.
Message has a getBody method
Holds
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.
2 rules from this sentence
MongoTemplate is in org.springframework.data.mongodb.core
Holds
ReactiveMongoTemplate is in org.springframework.data.mongodb.core
Holds
The javadoc:org.springframework.data.mongodb.core.MongoTemplate[] class implements the interface javadoc:org.springframework.data.mongodb.core.MongoOperations[].
MongoTemplate implements MongoOperations
Holds
For example, you can find methods such as find, findAndModify, findAndReplace, findOne, insert, remove, save, update, and updateMulti.
9 rules from this sentence
MongoOperations has a find method
Holds
MongoOperations has a findAndModify method
Holds
MongoOperations has a findAndReplace method
Holds
MongoOperations has a findOne method
Holds
MongoOperations has an insert method
Holds
MongoOperations has a remove method
Holds
MongoOperations has a save method
Holds
MongoOperations has an update method
Holds
MongoOperations has an updateMulti method
Holds
<T> T execute (Class<?> entityClass, CollectionCallback<T> action): Runs the given CollectionCallback for the entity collection of the specified class.
MongoTemplate has execute
Holds
The entry points (insert(…), find(…), update(…), and others) follow a natural naming schema based on the operation to be run.
2 rules from this sentence
FluentMongoOperations has an insert method
Holds
FluentMongoOperations has an update method
Holds
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
The IndexOperations interface has the getIndexInfo method that returns a list of IndexInfo objects.
2 rules from this sentence
IndexOperations depends on IndexInfo
Holds
IndexOperations has a getIndexInfo method
Holds
You can use the @TimeSeries#expireAfter option to have MongoDB automatically remove expired buckets.
TimeSeries has expireAfter
Holds
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
void save (Object objectToSave): Save the object to the default collection.
MongoTemplate has save
Holds
void insert (Object objectToSave): Insert the object to the default collection.
MongoTemplate has insert
Holds
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.
2 rules from this sentence
MongoOperations has an updateFirst method
Holds
MongoOperations has an updateMulti method
Holds
AggregationUpdate.set(...).toValue(...) -> $set : { ... }
AggregationUpdate has a set method
Holds
AggregationUpdate.unset(...) -> $unset : [ ... ]
AggregationUpdate has an unset method
Holds
AggregationUpdate.replaceWith(...) -> $replaceWith : { ... }
AggregationUpdate has a replaceWith method
Holds
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
<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
To remove a Document without version check use MongoOperations#remove(Query,...) instead of MongoOperations#remove(Object).
MongoOperations has remove
Holds
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.
4 rules from this sentence
GridFsTemplate implements GridFsOperations
Holds
ReactiveGridFsTemplate implements ReactiveGridFsOperations
Holds
GridFsOperations is a contract
Holds
ReactiveGridFsOperations is a contract
Holds
The store(…) operations take an InputStream, a filename, and (optionally) metadata information about the file to store.
GridFsOperations has a store method
Holds
The metadata can be an arbitrary object, which will be marshaled by the MongoConverter configured with the GridFsTemplate.
GridFsTemplate depends on MongoConverter
Holds
The store(…) operations take an Publisher<DataBuffer>, a filename, and (optionally) metadata information about the file to store.
ReactiveGridFsOperations has a store method
Holds
The metadata can be an arbitrary object, which will be marshaled by the MongoConverter configured with the ReactiveGridFsTemplate.
ReactiveGridFsTemplate depends on MongoConverter
Holds
You can read files from the filesystem through either the find(…) or the getResources(…) methods.
2 rules from this sentence
GridFsOperations has a find method
Holds
GridFsOperations has a getResources method
Holds
It provides static factory methods to encapsulate default metadata fields (such as whereFilename() and whereContentType()) or a custom one through whereMetaData().
3 rules from this sentence
GridFsCriteria has a whereFilename method
Holds
GridFsCriteria has a whereContentType method
Holds
GridFsCriteria has a whereMetaData method
Holds
Earlier, we saw how to retrieve a single document by using the findOne and findById methods on MongoTemplate.
2 rules from this sentence
MongoTemplate has a findOne method
Holds
MongoTemplate has a findById method
Holds
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
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
The org.springframework.data.mongodb.core.geo package contains types such as GeoJsonPoint, GeoJsonPolygon, and others.
2 rules from this sentence
GeoJsonPoint is in org.springframework.data.mongodb.core.geo
Holds
GeoJsonPolygon is in org.springframework.data.mongodb.core.geo
Holds
To sort results by relevance according to the weights use TextQuery.sortByScore.
TextQuery has sortByScore
Holds
<2> Use TextQuery.includeScore() to include the calculated relevance in the resulting Document.
TextQuery has an includeScore method
Holds
TextCriteria.matching takes the provided term as is.
TextCriteria has matching
Holds
83 rules from 14 docs

More open-source reports

Every report →

Other public repositories whose docs Striff read and checked against their code.