Skip to content

MongoItemReaderBuilder shouldn't be throwing an error related to the limit in query when pageSize is provided #3673

Closed
@kexsteve

Description

@kexsteve

Assert.state(this.query.getLimit() != 0, "PageSize in Query object was ignored.");

For example:

new MongoItemReaderBuilder<Document>()
            .collection("test")
            .template(mongoTemplate)
            .targetType(Document.class)
            .query(Query.query(Criteria.where("active").is(false))
            .sorts(ImmutableMap.of("_id", Sort.Direction.ASC))
            .pageSize(100)
            .build();

The line throw an error in MongoItemReaderBuilder:
Assert.state(this.query.getLimit() != 0, "PageSize in Query object was ignored.")

This has been just a warning in MongoItemReader:
log.warn("PageSize in Query object was ignored. Please set it by MongoItemReader.setPageSize().");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions