Skip to content

Add support for json.Number #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

kpacha
Copy link

@kpacha kpacha commented Mar 9, 2023

Closes #27 and #63

@Gale-Zhang
Copy link

Gale-Zhang commented Mar 13, 2025

Hi! I have a self test with your branch and find that base operators(>, <, = ...) still not support json.Number. Following is a case:

jmespath:

sum(Stats[?Value>`1`].Value)

jsonData:

{
    "Stats":
    [
        {
            "ValueFloat": 1,
            "Interval": 9,
            "ItemType": 1,
            "Item": "123",
            "TimeSlot": "2025-01-01",
            "Value": 1
        },
        {
            "ValueFloat": 1,
            "Interval": 9,
            "ItemType": 1,
            "Item": "456",
            "TimeSlot": "2025-01-02",
            "Value": 3
        },
        {
            "ValueFloat": 1,
            "Interval": 9,
            "ItemType": 1,
            "Item": "789",
            "TimeSlot": "2025-01-03",
            "Value": 1
        }
    ],
    "DataReadyStatus":
    [],
    "Versions":
    [
        1
    ],
    "BaseResp":
    {
        "StatusMessage": "success",
        "StatusCode": 0
    }
}

the result is 0, which seems that all items have been filterred due to json.Number > operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

json.Number format is not supported
2 participants