Skip to content

CozoDB query doubts #53

Answered by zh217
shivarajmulimani asked this question in Q&A
Apr 11, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Basically you just put a new row, overwriting the existing one. There is no update equivalent in CozoDB.

For example, if you want to update based on the ID, you have to retrieve the other fields manually (for the moment):

?[username, id, age, height, weight] := id = $id, *user{id, username, height, weight}, age = $new_age

:put user{id => username, age, height, weight}

Note that age comes from the query parameter, not from the table.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@infogulch
Comment options

@zh217
Comment options

Answer selected by shivarajmulimani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants