Skip to content

How to post range type? #1960

Answered by steve-chavez
morfair asked this question in Q&A
Sep 21, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Here's an example using a numrange

create table ranges (
    id integer primary key,
    range numrange
);
http POST 'localhost:3000/ranges' <<JSON
{"id": 5, "range": "(15,21]"}
JSON

http GET 'localhost:3000/ranges?id=eq.5'

[
    {
        "id": 5,
        "range": "(15,21]"
    }
]

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by steve-chavez
Comment options

You must be logged in to vote
1 reply
@steve-chavez
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1958 on September 21, 2021 23:57.