Update a value in a single column using the API [May 03]

:raising_hand_man: Shard asked

How do I update a value in a single column using the API? DB Query equivalent: UPDATE table_name SET "column_B" = true WHERE "column_A" = "example_value"

:raising_hand_man: wkw replied

u can use bulk update

:raising_hand_man: wkw replied

with where clause specfied

:raising_hand_man: Shard replied

How would a call like that look? or where can I see some examples?

:raising_hand_man: wkw replied

curl -X ‘PATCH’ \

http://localhost:8080/api/v1/db/data/bulk/noco/sakila/testApi/all?where=(Id,gt,7) \

-H “Content-Type: application/json” \

-H ‘accept: application/json’ \

-H ‘xc-auth: ’ \

–data ‘{ “Title”: “Updated” }’

:raising_hand_man: wkw replied

the url is /api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}/

:raising_hand_man: wkw replied

u may create a dummy table n use swagger ui to try

:raising_hand_man: Shard replied

Using that I get: invalid input syntax for type integer: "all"

:raising_hand_man: Shard replied

nevermind, I figured it out :slightly_smiling_face:

:raising_hand_man: Shard replied

Thanks!

Autogenerated from discord


Join NocoDB’s community

DiscordTwitterRedditDocs