How to use the PostgresSql REST API

I create a service select databse postgreSQL. And creata table ,insert data in the database.
It’s the sql:

create table if not exists name_age (  
    info jsonb
)

insert into name_age values('{"id":1,"name":"Ben", "age":18}');  
insert into name_age values('{"id":1,"name":"Jon", "age":20}'); 

How to filter "age":20 by REST API .
Hope that the result is to execute the following sql:

select info from name_age where info @> '{"age":20}'::jsonb

REST API :http://127.0.0.1:8099/api/v2/postgretest/_table/name_age

Hi @wang4978,

To add a filter, it would be added at the end of the url structure following a ?. So your url structure would look like (https://cl.ly/ea9db4ddbf4d) where I am filtering by department number.

Best,
Kevin McGahey

Thanks,Kevin,

I add a filter at the end of the url:

http://127.0.0.1:8099/api/v2/postgretest/_table/test1?filter=(info%20@>'{"age":"20"}')

Postman show the result :

{
    "error": {
        "code": 400,
        "context": null,
        "message": "Invalid or unparsable field in filter request: 'info @'",
        "status_code": 400
    }
}

Could you try ?filter=age=20 for me please I believe that is the correct way for what you are trying to do.

Thanks , Kevin,
I tried this way:

http://127.0.0.1:8099/api/v2/postgretest/_table/name_age?filter=age=20

And get the result:
{ "error": { "code": 400, "context": null, "message": "Invalid or unparsable field in filter request: 'age'", "status_code": 400 } }

Hi @wang4978,

Could you please try
http://127.0.0.1:8099/api/v2/postgretest/_table/name_age?filter=(age=20)