Skip to content

Fix typo in query limit assertion message of MongoTemplate and ReactiveMongoTemplate #5002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
* @author Michael Krog
* @author Jakub Zurawa
* @author Florian Lüdiger
* @author Seungho Kang
*/
public class MongoTemplate implements MongoOperations, ApplicationContextAware, IndexOperationsProvider,
SearchIndexOperationsProvider, ReadPreferenceAware {
Expand Down Expand Up @@ -1159,7 +1160,7 @@ <T, R> GeoResults<R> doGeoNear(NearQuery near, Class<?> domainType, String colle
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(resultType, "ResultType must not be null Use Object.class instead");

Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 or none");
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");

MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityType);
Expand Down Expand Up @@ -2129,7 +2130,7 @@ protected <S, T> UpdateResult replace(Query query, Class<S> entityType, T replac
Assert.notNull(entityType, "EntityType must not be null");
Assert.notNull(collectionName, "CollectionName must not be null");

Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 or none");
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");

UpdateContext updateContext = queryOperations.replaceSingleContext(query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
* @author Mathieu Ouellet
* @author Yadhukrishna S Pai
* @author Florian Lüdiger
* @author Seungho Kang
* @since 2.0
*/
public class ReactiveMongoTemplate implements ReactiveMongoOperations, ApplicationContextAware {
Expand Down Expand Up @@ -1193,7 +1194,7 @@ public <S, T, R> Mono<R> findAndReplace(Query query, S replacement, FindAndRepla
Assert.notNull(collectionName, "CollectionName must not be null");
Assert.notNull(resultType, "ResultType must not be null Use Object.class instead");

Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 ore none");
Assert.isTrue(query.getLimit() <= 1, "Query must not define a limit other than 1 or none");
Assert.isTrue(query.getSkip() <= 0, "Query must not define skip");

MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityType);
Expand Down