Hi, I've noticed an issue where it's not possible to delete multiple records at the same time.
For example, the follwing code deletes records one by one:
db.collections.get('comments').query().destroyAllPermanently()
Is it possible to delete multiple records at the same time?
Same problem
I dug up the solution:
const comments = await db.collections
.get('comments')
.query()
.fetch()
const deleted = comments.map(comment => comment.prepareDestroyPermanently())
db.batch(...deleted)
Exellent job!
@NikolaMasulovic @markorusic Check out record.experimentalDestroyPermanently() -- this will delete record & all its children
Most helpful comment
I dug up the solution: