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

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([
{subject: 'reading', status: 'executing'},
{subject: 'programming', status: 'finished'}
]).then(function() {
Task.destroy(
{ where: {subject: 'programming'}} /* where criteria */,
{truncate: true /* truncate the whole table, ignoring where criteria */} /* options */
).then(function(affectedRows) {
Task.destroy({
where: {
subject: 'programming'
},
truncate: true /* this will ignore where and truncate the table instead */
}).then(function(affectedRows) {
// affectedRows will be 2
Task.findAll().then(function(tasks) {
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!