{"id":55761,"date":"2022-11-28T10:24:50","date_gmt":"2022-11-28T04:54:50","guid":{"rendered":"https:\/\/2thenew.today\/blog\/?p=55761"},"modified":"2022-11-28T10:26:18","modified_gmt":"2022-11-28T04:56:18","slug":"use-drush-command-with-batch-to-update-node","status":"publish","type":"post","link":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/","title":{"rendered":"Use Drush command with Batch to update Node"},"content":{"rendered":"<p>In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using\u00a0 Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below:<\/p>\n<p>Example: In the below example, we are updating the article content type <strong>Title<\/strong> field with a dummy value by dividing it into chunks of 100, similarly can add your own logic.<\/p>\n<p>To create a custom module, follow the below steps, which will help create a custom Drush Command <strong>update:node article.<\/strong><\/p>\n<ol>\n<li><strong>Create <em>BatchDrushCommand.php<\/em> file under the custom module\/Commands folder.<\/strong>\n<div>\n<pre>&lt;?php\r\n\r\nnamespace Drupal\\module_name\\Commands;\r\n\r\nuse Drupal\\Core\\Entity\\EntityTypeManagerInterface;\r\n\r\nuse Drupal\\Core\\Logger\\LoggerChannelFactoryInterface;\r\n\r\nuse Drush\\Commands\\DrushCommands;\r\n\r\n\/**\r\n\r\n* A Drush commandfile for defining the command and callback method to it.\r\n\r\n*\/\r\n\r\nclass BatchDrushCommand extends DrushCommands {\r\n\r\n\/**\r\n\r\n* Entity type service.\r\n\r\n*\r\n\r\n* @var \\Drupal\\Core\\Entity\\EntityTypeManagerInterface\r\n\r\n*\/\r\n\r\nprivate $entityTypeManager;\r\n\r\n\/**\r\n\r\n* Logger service.\r\n\r\n*\r\n\r\n* @var \\Drupal\\Core\\Logger\\LoggerChannelFactoryInterface\r\n\r\n*\/\r\n\r\nprivate $loggerChannelFactory;\r\n\r\n\/**\r\n\r\n*\r\n\r\n* @param \\Drupal\\Core\\Entity\\EntityTypeManagerInterface $entityTypeManager\r\n\r\n* Entity type service.\r\n\r\n* @param \\Drupal\\Core\\Logger\\LoggerChannelFactoryInterface $loggerChannelFactory\r\n\r\n* Logger service.\r\n\r\n*\/\r\n\r\npublic function__construct(EntityTypeManagerInterface$entityTypeManager, LoggerChannelFactoryInterface$loggerChannelFactory) {\r\n\r\n$this-&gt;entityTypeManager = $entityTypeManager;\r\n\r\n$this-&gt;loggerChannelFactory = $loggerChannelFactory;\r\n\r\n}\r\n\r\n\/**\r\n\r\n* Update Node.\r\n\r\n*\r\n\r\n* @param string $type\r\n\r\n* Type of node to update\r\n\r\n* Argument provided to the drush command.\r\n\r\n*\r\n\r\n* @command update:node\r\n\r\n* @aliases update-node\r\n\r\n*\r\n\r\n* @usage update:node article\r\n\r\n*\/\r\n\r\npublic functionupdateNode($type = '') {\r\n\r\n\/\/ 1. Log the start of the script.\r\n\r\n$this-&gt;loggerChannelFactory-&gt;get('module_name')-&gt;info('node update started');\r\n\r\n\/\/ Check the type of node given as argument, if not, set article as default.\r\n\r\nif (strlen($type) == 0) {\r\n\r\n$type = 'article';\r\n\r\n}\r\n\r\n\/\/ 2. Retrieve all nodes of this type.\r\n\r\ntry {\r\n\r\n$storage = $this-&gt;entityTypeManager-&gt;getStorage('node');\r\n\r\n$query = $storage-&gt;getQuery()\r\n\r\n-&gt;condition('type', $type)\r\n\r\n-&gt;condition('status', '1');\r\n\r\n$nidsCount = $query-&gt;execute();\r\n\r\n$nidsCount = count($nidsCount);\r\n\r\n}\r\n\r\ncatch (\\Exception$e) {\r\n\r\n$this-&gt;output()-&gt;writeln($e);\r\n\r\n$this-&gt;loggerChannelFactory-&gt;get('module_name')-&gt;warning('Error found @e', ['@e' =&gt; $e]);\r\n\r\n}\r\n\r\n\/\/ 3. Create the operations array for the batch.\r\n\r\n$operations = [];\r\n\r\n$numOperations = 0;\r\n\r\n$batchId = 1;\r\n\r\nif ($nidsCount &gt; 0) {\r\n\r\nfor ($i = 0; $i &lt; $nidsCount;) {\r\n\r\n$query = $storage-&gt;getQuery()\r\n\r\n-&gt;condition('type', $type)\r\n\r\n-&gt;range($i, 100)\r\n\r\n-&gt;condition('status', '1');\r\n\r\n$nids = $query-&gt;execute();\r\n\r\n$articleId = array_keys($nids);\r\n\r\n$operations[] = [\r\n\r\n'\\Drupal\\module_name\\UpdateNode::articleUpdate',\r\n\r\n[\r\n\r\n$batchId, $articleId,\r\n\r\n],\r\n\r\n];\r\n\r\n$batchId++;\r\n\r\n$numOperations++;\r\n\r\n$i = $i + 100;\r\n\r\n}\r\n\r\n}\r\n\r\nelse {\r\n\r\n$this-&gt;logger()-&gt;warning('No nodes of this type @type', ['@type' =&gt; $type]);\r\n\r\n}\r\n\r\n\/\/ 4. Create the batch.\r\n\r\n$batch = [\r\n\r\n'title' =&gt; t('Updating @num node(s)', ['@num' =&gt; $numOperations]),\r\n\r\n'operations' =&gt; $operations,\r\n\r\n'finished' =&gt; '\\Drupal\\module_name\\UpdateNode::articleUpdateFinished',\r\n\r\n];\r\n\r\n\/\/ 5. Add batch operations as new batch sets.\r\n\r\nbatch_set($batch);\r\n\r\n\/\/ 6. Process the batch sets.\r\n\r\ndrush_backend_batch_process();\r\n\r\n}\r\n\r\n}<\/pre>\n<\/div>\n<pre><\/pre>\n<\/li>\n<li><strong>\u00a0Create a Helper File named <em>UpdateNode.php<\/em> in which we will write the articleUpdate and articleUpdateFinished function\u00a0<\/strong>\n<div>\n<pre>&lt;?php\r\n\r\nnamespace Drupal\\module_name;\r\n\r\n\/**\r\n\r\n* Class RevisionBatchProcess.\r\n\r\n*\/\r\n\r\nclass UpdateNode {\r\n\r\n\/**\r\n\r\n* articleUpdate callback.\r\n\r\n*\/\r\n\r\npublic function articleUpdate($id, $articleId, &amp;$context) {\r\n\r\nforeach ($articleId as $nid) {\r\n\r\n\/\/ Simulate long process by waiting 100 microseconds.\r\n\r\nusleep(100);\r\n\r\n$entityService = \\Drupal::entityTypeManager();\r\n\r\n$articleObject = $entityService-&gt;getStorage('node')-&gt;loadRevision($nid);\r\n\r\n$articleObject-&gt;set('title', 'update-title');\r\n\r\n$articleObject-&gt;save();\r\n\r\n$context['results'][] = $id;\r\n\r\n$context['message'] = t('processing \"@id\" @response',\r\n\r\n['@id' =&gt; $id, '@response' =&gt; $nid]\r\n\r\n);\r\n\r\n}\r\n\r\n}\r\n\r\n\/**\r\n\r\n* articleUpdateFinished callback.\r\n\r\n*\/\r\n\r\npublic function articleUpdateFinished($success, array $results, array $operations) {\r\n\r\n$messenger = \\Drupal::messenger();\r\n\r\nif ($success) {\r\n\r\n$messenger-&gt;addMessage(t('@count results processed.', ['@count' =&gt; count($results)]));\r\n\r\n}\r\n\r\n}\r\n\r\n}<\/pre>\n<\/div>\n<p>Once the code is added to the module, enable the module or if you are using the existing module, then clear the drupal cache and run the <strong>drush update:node article<br \/>\n<\/strong>command.<\/p>\n<p>Please add comments if you have any queries or doubts.<\/li>\n<\/ol>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using\u00a0 Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a [&hellip;]<\/p>\n","protected":false},"author":1513,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":128,"footnotes":""},"categories":[3602],"tags":[5043],"class_list":["post-55761","post","type-post","status-publish","format-standard","hentry","category-drupal","tag-drupal-batchapiupdatenodedrushcommanddrush"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Anurag Nagar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Use Drush command with Batch to update Node | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Use Drush command with Batch to update Node | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#article\",\"name\":\"Use Drush command with Batch to update Node | TO THE NEW Blog\",\"headline\":\"Use Drush command with Batch to update Node\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/anurag-nagar\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2022-11-28T10:24:50+05:30\",\"dateModified\":\"2022-11-28T10:26:18+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#webpage\"},\"articleSection\":\"Drupal, drupal batchapiupdatenodedrushcommanddrush\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"name\":\"Drupal\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"position\":2,\"name\":\"Drupal\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#listItem\",\"name\":\"Use Drush command with Batch to update Node\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#listItem\",\"position\":3,\"name\":\"Use Drush command with Batch to update Node\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"name\":\"Drupal\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/anurag-nagar\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/anurag-nagar\\\/\",\"name\":\"Anurag Nagar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/8e8a2828-4198-446e-9532-a001b924338a_Anurag-Nagar-Profile-Pitcure.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Anurag Nagar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/\",\"name\":\"Use Drush command with Batch to update Node | TO THE NEW Blog\",\"description\":\"In this tutorial, we are going learn how to create\\\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/use-drush-command-with-batch-to-update-node\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/anurag-nagar\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/anurag-nagar\\\/#author\"},\"datePublished\":\"2022-11-28T10:24:50+05:30\",\"dateModified\":\"2022-11-28T10:26:18+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Use Drush command with Batch to update Node | TO THE NEW Blog","description":"In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a","canonical_url":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#article","name":"Use Drush command with Batch to update Node | TO THE NEW Blog","headline":"Use Drush command with Batch to update Node","author":{"@id":"https:\/\/2thenew.today\/blog\/author\/anurag-nagar\/#author"},"publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"},"datePublished":"2022-11-28T10:24:50+05:30","dateModified":"2022-11-28T10:26:18+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#webpage"},"articleSection":"Drupal, drupal batchapiupdatenodedrushcommanddrush"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.today\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/drupal\/#listItem","name":"Drupal"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/drupal\/#listItem","position":2,"name":"Drupal","item":"https:\/\/2thenew.today\/blog\/category\/drupal\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#listItem","name":"Use Drush command with Batch to update Node"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#listItem","position":3,"name":"Use Drush command with Batch to update Node","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/drupal\/#listItem","name":"Drupal"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.today\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.today\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.today\/blog\/author\/anurag-nagar\/#author","url":"https:\/\/2thenew.today\/blog\/author\/anurag-nagar\/","name":"Anurag Nagar","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/8e8a2828-4198-446e-9532-a001b924338a_Anurag-Nagar-Profile-Pitcure.jpeg","width":96,"height":96,"caption":"Anurag Nagar"}},{"@type":"WebPage","@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#webpage","url":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/","name":"Use Drush command with Batch to update Node | TO THE NEW Blog","description":"In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.today\/blog\/author\/anurag-nagar\/#author"},"creator":{"@id":"https:\/\/2thenew.today\/blog\/author\/anurag-nagar\/#author"},"datePublished":"2022-11-28T10:24:50+05:30","dateModified":"2022-11-28T10:26:18+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.today\/blog\/#website","url":"https:\/\/2thenew.today\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Use Drush command with Batch to update Node | TO THE NEW Blog","og:description":"In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a","og:url":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/","og:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Use Drush command with Batch to update Node | TO THE NEW Blog","twitter:description":"In this tutorial, we are going learn how to create\/update nodes with the help of the Drush command using Batch API in Drupal. For that, we need to create a custom module. The file structure will be like below: Example: In the below example, we are updating the article content type Title field with a","twitter:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"55761","title":null,"description":null,"keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":{"id":"#aioseo-article-65e040af7cb89","slug":"article","graphName":"Article","label":"Article","properties":{"type":"BlogPosting","name":"#post_title","headline":"#post_title","description":"#post_excerpt","image":"","keywords":"","author":{"name":"#author_name","url":"#author_url"},"dates":{"include":true,"datePublished":"","dateModified":""}}},"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2022-11-24 07:47:43","updated":"2024-02-29 08:30:39","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.today\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.today\/blog\/category\/drupal\/\" title=\"Drupal\">Drupal<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tUse Drush command with Batch to update Node\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.today\/blog"},{"label":"Drupal","link":"https:\/\/2thenew.today\/blog\/category\/drupal\/"},{"label":"Use Drush command with Batch to update Node","link":"https:\/\/2thenew.today\/blog\/use-drush-command-with-batch-to-update-node\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/55761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/users\/1513"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/comments?post=55761"}],"version-history":[{"count":3,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/55761\/revisions"}],"predecessor-version":[{"id":55853,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/55761\/revisions\/55853"}],"wp:attachment":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/media?parent=55761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/categories?post=55761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/tags?post=55761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}