Encode to use N1QL ordering