You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All deleted materials (physicals or virtuals) should be copied to a sublevel before deletion. This should be done as a batch so it stays atomic. The key in this "list of deleted materials" sublevel should be datetime, sorted by newest first.
New API functions:
List deleted materials in newest-first order
Restore material
Permanently delete (remove from list of deleted materials)
This sublevel should auto-delete anything older than 30 days.
Restore material should copy the material back to the normal sublevel from whence it was deleted and remove the entry from the list of deleted items. Again as an atomic batch operation.
The text was updated successfully, but these errors were encountered:
Undeletion API is implemented but untested. I'm working on #182 and will then implement tests for this.
How it works
Anything deleted with delPhysical is automatically saved in a separate database before deletion.
There are three new calls: listDeleted, clearDeleted and undelete.
listDeleted(); // returns a stream of all deleted (keys and values)
listDeleted streams items like this:
{
key: myKey // key used to undelete
value: {
db: dbName, // name of database from which the item was deleted, e.g. "physical"
key: someKey, // full key, should not be used by client
deletedAt: someTime, // deletion time in microseconds since unix epoch
deletedBy: email, // email address of user that deleted this
data: { ... } // the actual deleted object
}
}
clearDeleted(callback); // permanently delete the deleted items (empty recycle bin)
undelete(key, callback); // undelete the item and remove it from the list of deleted items
All deleted materials (physicals or virtuals) should be copied to a sublevel before deletion. This should be done as a batch so it stays atomic. The key in this "list of deleted materials" sublevel should be datetime, sorted by newest first.
New API functions:
This sublevel should auto-delete anything older than 30 days.
Restore material should copy the material back to the normal sublevel from whence it was deleted and remove the entry from the list of deleted items. Again as an atomic batch operation.
The text was updated successfully, but these errors were encountered: