in reply to Preserve the order in JSON
I'm curious why you need the order preserved? Perhaps you need to add a field to store a sorting key?