{"id":27,"date":"2021-01-14T07:40:11","date_gmt":"2021-01-14T07:40:11","guid":{"rendered":"https:\/\/mouryasolutions.in\/blog\/?p=27"},"modified":"2023-01-29T18:06:59","modified_gmt":"2023-01-29T18:06:59","slug":"firebase-database-single-node-update","status":"publish","type":"post","link":"https:\/\/mouryasolutions.in\/blog\/firebase-database-single-node-update\/","title":{"rendered":"Firebase database single node update"},"content":{"rendered":"<div class=\"post-content\">\n<blockquote class=\"wp-block-quote\">\n<p>In Firebase Realtime Database, you can update a single node using the Firebase Realtime Database REST API. Here is an example in PHP using the Guzzle HTTP Client:<\/p>\n<\/blockquote>\n\n\n\n<h4>First, install the Guzzle HTTP Client:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require guzzlehttp\/guzzle\r<\/code><\/pre>\n\n\n\n<h4>Next, you can use the following code to update a single node:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>use GuzzleHttp\\Client;\r\n\r\n$client = new Client();\r\n$node = &#91;\r\n    'value' => 'new value',\r\n];\r\n$client->request('PATCH', 'https:\/\/&lt;DATABASE_NAME>.firebaseio.com\/&lt;NODE_NAME>.json', &#91;\r\n    'json' => $node,\r\n]);\r\n<\/code><\/pre>\n\n\n\n<p>Note: Replace <code>&lt;DATABASE_NAME&gt;<\/code> and <code>&lt;NODE_NAME&gt;<\/code> with your Firebase Realtime Database name and node name respectively.<\/p>\n<\/div><!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>In Firebase Realtime Database, you can update a single node<a href=\"https:\/\/mouryasolutions.in\/blog\/firebase-database-single-node-update\/\">Read More<i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"><\/i><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts\/27"}],"collection":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":4,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":474,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions\/474"}],"wp:attachment":[{"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mouryasolutions.in\/blog\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}