I created a custom command in my AdonisJs project (I use v6).
I import a model and try to insert objects into it:
import Country from '../app/models/country.js'
import Region from '../app/models/region.js'
import City from '../app/models/city.js'
async run() {
await Country.create({
name: 'Andorra',
isoCode: 'AD',
numLevels: 2,
levelNames: "['state','city']",
})
I get this error:
[ error ] Cannot read properties of undefined (reading ‘insert’)
I will be grateful for any hint or idea how to either solve or debug this error.