问题
Firbase db structure is information->[key1=>[id=>1,value=>value1,status=>1],key2=>[id=>2,value=>value2,status=>1]...]
I have array of keys (eg:key1,key3
) needs to delete.That is delete node information->key(eg:info=>key1,info->key3
).How can i write delete query using php?
I tried using this code.
$deleteionKeys = [];
foreach ( $data as $key => $value ) {
$deleteionKeys = array_merge( $deleteionKeys, ["{$key}" ] );
}
$firebase = new \FirebaseDB( "information" );
$data = $firebase->getChild($deleteionKeys);
$data->remove();
来源:https://stackoverflow.com/questions/62302397/needs-to-delete-firebase-db-node-using-multiple-keys-array-in-php