Skip to content

rust: db.update and WHERE #2737

Closed Answered by naisofly
mirsella asked this question in Q&A
Sep 19, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@mirsella Yes, that's true. To use WHERE clauses you will need to use Surreal::query which, in your words, involves building a query.

Also Surreal::update supports updating:

  • the entire table by feeding it only a table name
  • a specific record by feeding it a table name and ID (i.e. record ID)
  • a range of records by feeding it a table name and then specifying a range of records using the range method.

You just can't update specific records by filtering on any other field except id.

Hope this helps!

Replies: 1 comment 2 replies

Comment options

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

@naisofly
Comment options

Answer selected by mirsella
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