Skip to content

Conversation

KSH-code
Copy link
Contributor

@KSH-code KSH-code commented Apr 4, 2024

If use a querydsl with mongo such as

from(collection)
            .where(predicate)
            .orderBy(orderField.asc())
            .offset(pageable.offset)
            .limit(pageable.pageSize.toLong())
            .fetch()

and also log is enabled,

Then this query logs like

[C] 2024-04-04T16:06:13.855+09:00|DEBUG|pool-1-thread-1 @coroutine#3||MongoTemplate.java:2691|find using query: { "updatedAt" : { "$gte" : { "$date" : "2024-04-03T07:06:13.829Z"}, "$lte" : { "$date" : "2024-04-04T07:06:13.829Z"}}} fields: Document{{}} for class: class blahblah in collection: Collection

Thus it needs to be logged with sort query.

close #4686

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 4, 2024
@KSH-code KSH-code changed the title Add a sort options Add a sort options for find queries Apr 4, 2024
@KSH-code KSH-code changed the title Add a sort options for find queries Add logging a sort options for find queries Apr 4, 2024
@KSH-code KSH-code marked this pull request as ready for review April 4, 2024 07:16
@KSH-code
Copy link
Contributor Author

KSH-code commented Apr 4, 2024

@pivotal-cla This is an Obvious Fix

@KSH-code KSH-code closed this Apr 9, 2024
@KSH-code KSH-code reopened this Apr 9, 2024
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 10, 2024
@mp911de mp911de self-assigned this Apr 10, 2024
mp911de pushed a commit that referenced this pull request Apr 10, 2024
Closes #4686
Original pull request: #4679
mp911de added a commit that referenced this pull request Apr 10, 2024
Consistent log field ordering, serialize sort safely.

See #4686
Original pull request: #4679
mp911de pushed a commit that referenced this pull request Apr 10, 2024
Closes #4686
Original pull request: #4679
mp911de added a commit that referenced this pull request Apr 10, 2024
Consistent log field ordering, serialize sort safely.

See #4686
Original pull request: #4679
mp911de pushed a commit that referenced this pull request Apr 10, 2024
Closes #4686
Original pull request: #4679
mp911de added a commit that referenced this pull request Apr 10, 2024
Consistent log field ordering, serialize sort safely.

See #4686
Original pull request: #4679
@mp911de mp911de added this to the 4.1.11 (2023.0.11) milestone Apr 10, 2024
@mp911de
Copy link
Member

mp911de commented Apr 10, 2024

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this Apr 10, 2024
natedanner pushed a commit to natedanner/spring-projects__spring-data-mongodb that referenced this pull request May 20, 2024
natedanner pushed a commit to natedanner/spring-projects__spring-data-mongodb that referenced this pull request May 20, 2024
Consistent log field ordering, serialize sort safely.

See spring-projects#4686
Original pull request: spring-projects#4679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a debug information for sort fields when using findByQuery
3 participants