0

I am trying to emulate UPDATE user SET userDetails = JSON_SET(userDetails, '$.name', 'Alok') WHERE id = 1; to update JSON value using X Dev API.

var updateValue = `JSON_SET(userDetails, '$.name', 'Alok')`
var result = await db.getTable('user').update().set('userDetails', updateValue).where(`id = 1`).execute()

I am getting error

Error: Invalid JSON text: "Invalid value." at position 0 in value for column 'user.userDetails'.

Suppose I dont want to run raw SQL query. I want to do this using X Dev API. How can I achieve this?

Alok
  • 7,734
  • 8
  • 55
  • 100

0 Answers0