You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying createmany function on adonis repl but receive this exception. createMany still working on seeder.
> let payloadArray = [{username:'showcheap',email:'admin@sucipto.net',password:'admin',name:'Sucipto'}]
undefined
> payloadArray instanceof Array === false
false
> await use('App/Models/User').createMany(payloadArray)
InvalidArgumentException: E_INVALID_PARAMETER: User.createMany expects an array of values instead received array
at Function.invalidParameter (/home/sucipto/Dev/js/devhunt/node_modules/@adonisjs/generic-exceptions/src/InvalidArgumentException.js:52:12)
at Function.createMany (/home/sucipto/Dev/js/devhunt/node_modules/@adonisjs/lucid/src/Lucid/Model/index.js:449:10)
at repl:1:30
at ContextifyScript.Script.runInContext (vm.js:53:29)
at REPLServer.onLine (repl.js:440:10)
at emitOne (events.js:120:20)
at REPLServer.emit (events.js:210:7)
at REPLServer.Interface._onLine (readline.js:279:10)
at REPLServer.Interface._line (readline.js:626:8)
at REPLServer.Interface._ttyWrite (readline.js:906:14)
at REPLServer.self._ttyWrite (repl.js:509:7)
at ReadStream.onkeypress (readline.js:158:10)
>
The text was updated successfully, but these errors were encountered:
Ohhh yeah. As you saw payloadArray instanceof Array returns false when running in REPL. I have remove all these statements from the codebase and instead use Array.isArray method.
Trying createmany function on
adonis repl
but receive this exception.createMany
still working on seeder.The text was updated successfully, but these errors were encountered: