I have a nestjs app where I am using objectionjs and knex to communicate with my mysql db. The address field is a json like:
data = {
address: { lat: 12, lng: 20 }
}
Whenever I run an update using:
this.personRepository
.query()
.update(data)
.where('id', person.id)
.execute()
I keep getting this error- Unknown column 'lng' in 'field list'
Full error is something like:
update `persons` set `address` = {"lat":12,"lng":20}, `updatedAt` = '2023-02-28 23:27:39.476' where `id` = X'1234567'
Please help me point out what I'm doing wrong.