can i output for order by fields? #1114
-
some time ,i want to diff order by field print ,how to code it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
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.