Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

error in string sorting #579

@hereisok

Description

@hereisok

hi, The couchdb version I use is 3.1.0.

Below is my document in the database,

_id group_id msg_id
H-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= H
h-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= h
b-lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= b
A-lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= A
a-lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= a
7ewRhpLu5-567jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= 7ewRhpLu5
7ewRHPJZN-567jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= lEJXOvV-jqPgaMjkaqpmZsyX97_uMOtD3rsYPcABjz8= 7ewRHPJZN

I created an index:

{
        "index": {
            "fields": ["group_id", "msg_id"]
        },
        "name": "msg-id-index",
        "type": "json",
        "ddoc": "_design/index_msg-id-index"
}

Then sort query based on msg_id. Below is the result of my query.

image

According to couchdb's documentation, I know that the order of "H" is higher than "h", but why is the order of "7ewRhpLu5" higher than "7ewRHPJZN"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions