PUT
/
db
/
update
JavaScript
import Worqhat from 'worqhat';

const client = new Worqhat({
  apiKey: 'My API Key',
});

const response = await client.db.updateRecords({
  data: { status: 'active' },
  table: 'users',
  where: { id: '123' },
});

console.log(response.count);
{
  "success": true,
  "data": [
    {}
  ],
  "count": 123,
  "message": "Data updated successfully"
}

Authorizations

Authorization
string
header
required

API key authentication. Format - "Bearer YOUR_API_KEY"

Body

application/json
table
string
required

Table name to update

Example:

"users"

data
object
required

Data to update

Example:
{ "status": "active" }
where
object
required

Where conditions

Example:
{ "id": "123" }

Response

Data updated successfully

success
boolean
Example:

true

data
object[]
count
integer

Number of records updated

message
string
Example:

"Data updated successfully"