Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
@harut-g somewhat
I'm starting to think my logic is going to require way too much code and be ridiculously messy. I'm going to have to write an if/else statement for each choice and for each result the compPicker returns
@moT01 I have two create method on model, which saves the data. And I need to send some data when two methods is done, can you help me with it?
@IsaakNazar move the transtion to the .links
and it will work both ways
Plus all the if statements for all the win variables
@harut-g do you have the code somewhere?
This message was deleted
                Facility.create(filesJson['facilities'], (err, result) => {
                   if (err) throw err;

                People.create(filesJson['people'], (err, result) => {
                    if (err) throw err;
@moT01 I need to send response when these two methods are done
@moT01 yes
here's some code i've used
newBook.save().then(() => {
             books.find().then(r => {
i dunno, that's an area i need improvement on
so yours might look like...
facility.create(files.....).then((err,result) => {
   people.create().then( => {

probly not the best way to go, i think that stops the code - when ideally you probly want both of those to start together then send a response when the last one is done
someone posted a link to here about this - i didnt read it, but it might help http://www.datchley.name/es6-promises/
Chris Rutherford
anyone good with troubleshooting seed issues?
anyone here to answer questions?
i cant try
Chris Rutherford

thanks @moT01 , I'm trying to see my database, and have two models that I have the seed data for in a JSON file. Both seed scripts are nearly identical. The only difference is the JSON file that gets imported, and the variable name that represents the seed data after import. The first imports fine, and the second files with an error like this:

== 20171030160224-outsider: migrating =======
Seed file failed with error: Cannot read property 'autoIncrement' of undefined TypeError: Cannot read property 'autoIncr
ement' of undefined
    at C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\sequelize\lib\dialects\mssql\query-generator.js
    at C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\lodash\lodash.js:4389:15
    at baseForOwn (C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\lodash\lodash.js:2652:24)
    at Function.forOwn (C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\lodash\lodash.js:12254:24)
    at C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\sequelize\lib\dialects\mssql\query-generator.js
    at arrayEach (C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\lodash\lodash.js:473:11)
    at Function.forEach (C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\lodash\lodash.js:8561:14)
    at Object.bulkInsertQuery (C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\sequelize\lib\dialects\
    at QueryInterface.bulkInsert (C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\node_modules\sequelize\lib\query-
    at Object.up (C:\Users\rutherfordc.AA\Documents\GitHub\ccs-express\server\seeders\20171030160224-outsider.js:7:27)
    at Migration._callee$ (C:\Users\rutherfordc.AA\AppData\Roaming\npm\node_modules\sequelize-cli\node_modules\umzug\lib
    at tryCatch (C:\Users\rutherfordc.AA\AppData\Roaming\npm\node_modules\sequelize-cli\node_modules\regenerator-runtime
    at Generator.invoke [as _invoke] (C:\Users\rutherfordc.AA\AppData\Roaming\npm\node_modules\sequelize-cli\node_module
    at Generator.prototype.(anonymous function) [as next] (C:\Users\rutherfordc.AA\AppData\Roaming\npm\node_modules\sequ
    at step (C:\Users\rutherfordc.AA\AppData\Roaming\npm\node_modules\sequelize-cli\node_modules\babel-runtime\helpers\a
    at C:\Users\rutherfordc.AA\AppData\Roaming\npm\node_modules\sequelize-cli\node_modules\babel-runtime\helpers\asyncTo
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

The seed script is as follows:

'use strict';
const cjson = require('cjson');
var outsiderData = cjson.load('server/seeders/Outsider.json');

module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.bulkInsert('Outsiders', outsiderData);

  down: (queryInterface, Sequelize) => {
    return queryInterface.bulkDelete('Outsiders', null, {});
whats next
wheres the auto increment
Chris Rutherford
The auto increment is in the migration file, and is on the Id field that is provided by Sequelize when generating the Migration.
I assume the Next is something in the pipeline for Sequelize.
oh sorry this is the wrong chat.....
Thanks anyway Tom
you can chat wherever you want
Chris Rutherford
lol, I was looking for the Sequelize chat. though.... lol all good
well, i wanted to see where you were setting the autoIncrement - or where - or the code you were using to grab that info
it says undefined there, i think thats an async issue
or sync
How do you send a script instead of just copy-pasting?
Chris Rutherford

Yes, the code for the Auto Increment is here:

'use strict';
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('Outsiders', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      firstName: {
        type: Sequelize.STRING,
        allowNull: false

this is supposed to handle the auto increment of table keys on it's own, but I guess it's borked.

I'll link you my repo so you can take a look.
@cjrutherford yea, im not sure
if the first one works
try the second again
look for typos
is the file the right structure
im sure you did all that
Chris Rutherford
yeah, it's a quagmire, I'm going to look up another tutorial and start from scratch. they're really no help over there.
Kaz Baig
@alpox do you do sass
@kbaig I did do some
Long not anymore
Marius Nicolae
hi guys, i have a little issue, im trying to link in my JSON some objects
does someone here have some experience?