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).
This works in JS:
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);
I've already written a python script that does my bulk delete, but to my surprise it doesn't work as the JS code as it raises ValueError: Dictionary must not contain None keys or values.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/ca0ee946-5fc0-4c2f-8acb-3434e02576e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.