Skip to content

can i output for order by fields? #1114

Answered by abhinav
shangguanbucai asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @shangguanbucai, unfortunately Zap cannot change the order of the fields. One of the ways it gets its performance characteristics is by encoding JSON fields as it goes, without storing the fields in memory. To order them, we'd have to hold a collection of objects in memory before re-ordering them.

The only control for the order of the fields is the order in which you provide them.

Closing because answered. Feel free to re-open or create a new issue if you have more questions.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by abhinav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #1031 on June 15, 2022 12:49.