I have been trying to insert and array of objects into this jsonb column, but I guess the following error message:
insert into ... (...) values (...) on conflict ("source_id", "source", "type") do update set ... = ... returning "..." - invalid input syntax for type json
The error message is invalid input syntax for type json.
If I try to add an object, it works, but an array of the same object it does not work.
As I am using objection
together with knex
, I wonder if I can solve it by setting my static jsonSchema()
properly.
static get jsonSchema() {
return {
type: "object",
required: ["myJsonbColumn"],
properties: {
myJsonbColumn: {
type: "object",
},
},
};
}