不要怂,就是干,撸起袖子干!

Commit 6c468f63 by Steven Lu

Updating docs to reflect actual bulk delete

1 parent fcceefdf
Showing with 6 additions and 4 deletions
...@@ -176,10 +176,12 @@ Task.bulkCreate([ ...@@ -176,10 +176,12 @@ Task.bulkCreate([
{subject: 'reading', status: 'executing'}, {subject: 'reading', status: 'executing'},
{subject: 'programming', status: 'finished'} {subject: 'programming', status: 'finished'}
]).then(function() { ]).then(function() {
Task.destroy( Task.destroy({
{ where: {subject: 'programming'}} /* where criteria */, where: {
{truncate: true /* truncate the whole table, ignoring where criteria */} /* options */ subject: 'programming'
).then(function(affectedRows) { },
truncate: true /* this will ignore where and truncate the table instead */
}).then(function(affectedRows) {
// affectedRows will be 2 // affectedRows will be 2
Task.findAll().then(function(tasks) { Task.findAll().then(function(tasks) {
console.log(tasks) // no programming, just reading :( console.log(tasks) // no programming, just reading :(
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!