Feathersjs JSON Column

Viewed 25

How do I insert data into a JSON column?

I tried this in my schema:

    testThing: {
      type: 'array',
      items: {
        type: 'object',
        additionalProperties: false,
        required: ['stuff'],
        properties: {
          stuff: {
            type: 'string',
          },
        },
      },
    },

And this:

  await app.service('things').create({
    testThing: [
      {
        stuff: 'bla',
      },
      {
        stuff: 'bla',
      },
    ],
  })

But I get an error Column count doesn't match value count at row 1 as it seems to not encode the JSON when inserting.

0 Answers
Related