UPDATE
POST
The UPDATE statement is used to update one or multiple documents based on the WHERE clause.
UPDATE statement syntax
UPDATE [collection_name]
SET [$data:dict]
WHERE [$where:dict, a=b, ...]
OFFSET [$offset:number]
LIMIT [$limit:number]
LIMIT [$limit:number, $offset:number];
Query Example
{
"query": "UPDATE articles SET $data WHERE _key=$_key",
"variables": {
"_key": "01gpk6abb65f2pg33cz52fxqwc",
"data": {
"title": "Hello World"
}
}
}
{
"query": "UPDATE articles SET $data WHERE $where",
"variables": {
"where": {
"location:$in": ["NY", "NC"]
}
}
}
Request
- application/json
Body
query stringrequired
The X-SQL Query string
variables objectrequired
The variables
Responses
- 200
Mutation response
- application/json
- Schema
- Example (from schema)
Schema
data object[]
Array of documents mutated
{
"data": [
{}
]
}
Loading...