Moor: delete many

Created on 4 Sep 2019  路  3Comments  路  Source: simolus3/moor

Is there a way to delete multiple rows by feeding it a list of ids or other fields without writing custom SQL?

Most helpful comment

@rohansohonee r.id.isIn(listOfIds))

All 3 comments

Yes! You can use any where clause on a delete statement as well. To delete a list of ids, this should do the trick.

(delete(table)..where((r) => isIn(r.id, listOfIds))).go()

Any other where clause you could use on a select statement would work just as well. Let me know if you have any questions.

isIn is deprecated

Can you please provide latest solution for delete many

@rohansohonee r.id.isIn(listOfIds))

Was this page helpful?
0 / 5 - 0 ratings

Related issues

novas1r1 picture novas1r1  路  4Comments

cadaniel picture cadaniel  路  4Comments

felixjunghans picture felixjunghans  路  4Comments

simolus3 picture simolus3  路  4Comments

angel1st picture angel1st  路  4Comments