The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

568005 (1) [Avatar] Offline
#1
Hi,
After following the example in the book:


Video.create(foundVideos).exec(function(err, videoRecordsCreated){
            if(err){
              console.log('err', err);

              return cb(err);
            }
            console.log('videoRecordsCreated', videoRecordsCreated);
          });




I am getting the following error:

err { UsageError: Invalid new record.
Details:
Got an array, but expected new record to be provided as a dictionary (plain JavaScript object). Array usage is no longer supported as of Sails v1.0 / Waterline 0.13. Instead, please explicitly call `.createEach()`.

at Object.success (/Users/bliss/Documents/Coder/Sails/brushfire/config/bootstrap.js:72:17)
at afterwards (/Users/bliss/Documents/Coder/Sails/brushfire/node_modules/machinepack-youtube/node_modules/machine/lib/intercept-exit-callbacks.js:131:21)
at Timeout._onTimeout (/Users/bliss/Documents/Coder/Sails/brushfire/node_modules/machinepack-youtube/node_modules/machine/lib/intercept-exit-callbacks.js:98:20)
at ontimeout (timers.js:488:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:283:5)
name: 'UsageError',
code: 'E_INVALID_NEW_RECORD',
details: 'Got an array, but expected new record to be provided as a dictionary (plain JavaScript object). Array usage is no longer supported as of Sails v1.0 / Waterline 0.13. Instead, please explicitly call `.createEach()`.' }





How to work around this?
It seems like it is Sails that changed and the book did not update to change with the new Sails method....