The Firebase Python Admin SDK has a bulk update()
method, but you can't use it the same as the bulk deletes in the Javascript Admin SDK, since you cannot have None
dict values (SDK validation).
The SDK docs are sparse and there are next to no available examples. Does anyone know how to batch deletes in Python?
Example of bulk delete in Javascript:
const parentRef = db.reference('parent/foo/')
const children = parentRef.get()
const updates = {};
Object.keys(children).forEach( childKey => {
const childEntry = children(childKey)
if( shouldDelete(childEntry) ) {
updates[childKey] = null; // setting value to null deletes the key
}
}
parentRef.update(updates);