使用Firebase时,我需要批量 DELETE , POST 操作。
它是否支持REST API中的批处理操作?
答案 0 :(得分:5)
Firebase中最简单的“批处理”操作是在树中向上移动一级,然后执行PATCH或DELETE操作。
考虑以下数据结构:
/foo/bar
/foo/baz
/foo/bap
/foo/bam
如果我想删除bar
和baz
,我可以执行以下操作:
curl -X PATCH https://<instance>.firebaseio.com/<PATH>.json -d '{"bar": null, "baz": null}'