-
-
Notifications
You must be signed in to change notification settings - Fork 641
WriteableCollection.delete()
David Fahlander edited this page Apr 10, 2014
·
29 revisions
Deletes all objects in the query.
collection.delete()
Promise where result is an array of [key, value] of all deleted objects.
db.orders.where("state").anyOf("finished", "discarded").or("date").below("2014-02-01").delete()
.then(function (deletedOrders) {
console.log( JSON.stringify(deletedOrders) ):
});
This method is equivalent to the following:
var deletedRecords = [];
collection.each(function (item, cursor) {
deletedRecords.push([cursor.key, cursor.value]);
cursor.delete();
}).then (function () {
return deletedRecords;
});
Dexie.js - minimalistic and bullet proof indexedDB library