{"id":2081,"date":"2015-07-31T15:00:01","date_gmt":"2015-07-31T15:00:01","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2081"},"modified":"2025-06-13T23:47:48","modified_gmt":"2025-06-14T06:47:48","slug":"mass-deleting-documents-by-compound-key-prefix-using-node-js","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/","title":{"rendered":"Mass Deleting Documents by Compound Key Prefix Using Node.js"},"content":{"rendered":"<p>\n    A common question that gets asked in the <a href=\"https:\/\/www.couchbase.com\/forums\/\">Couchbase forums<\/a> and on Stack Overflow is how to<br \/>\n    delete all records from a bucket that have a key that starts with some value.  In other words, how to delete all records that share a<br \/>\n    particular compound key.  The simple solution is to create a Couchbase view and execute a range query.\n<\/p>\n<p>\n    You can execute range queries with all the Couchbase SDKs, but for this particular example we&#8217;re going to see how to do it with Node.js.\n<\/p>\n<h2>The Prerequisites<\/h2>\n<p>Before attempting the following, you should have the following installed and configured:<\/p>\n<ul>\n<li>Node.js and Node Package Manager (NPM) installed<\/li>\n<li>Couchbase 3.0+<\/li>\n<\/ul>\n<h2>Our Sample Data<\/h2>\n<p>\n    For the rest of this example we&#8217;re going to use some sample documents in a bucket that I&#8217;m going to call <strong>testbucket<\/strong>.<br \/>\n    The documents in our bucket will have the following key names:\n<\/p>\n<ul>\n<li>user::nraboy<\/li>\n<li>user::mingenthron<\/li>\n<li>user::blawson<\/li>\n<li>product::1<\/li>\n<li>product::2<\/li>\n<li>product::3<\/li>\n<\/ul>\n<p>\n    The content of these documents don&#8217;t really matter for this example.  What does matter is the prefix that I&#8217;ve chosen to use for each of the<br \/>\n    two document types.  I&#8217;ve chosen to use <strong>user::<\/strong> to represent user documents and <strong>product::<\/strong> to represent<br \/>\n    product documents.  The complete keys represent compound keys.\n<\/p>\n<h2>Creating our Couchbase View<\/h2>\n<p>\n    We have many documents (not really) in our Couchbase bucket.  Chances are we&#8217;re not going to remember all the keys to do direct key-value<br \/>\n    lookups.  For this reason we&#8217;re going to need to create a Couchbase View.\n<\/p>\n<p>\n    You can create Couchbase Views through code, but for this particular example we&#8217;re just going to create one via the Couchbase Dashboard.  Sign<br \/>\n    into the Couchbase Dashboard and click the <strong>Views<\/strong> tab and select the <strong>testbucket<\/strong> that you created earlier.\n<\/p>\n<p>\n    Choose to create a new development view and call the design document <strong>_design\/dev_docs<\/strong> with a view name of<br \/>\n    <strong>by_id<\/strong>.  The default view code should be fine, but just in case it is not, you want to make sure the view looks like the<br \/>\n    following:\n<\/p>\n<pre>\r\n<code class=\"language-javascript\">\r\nfunction (doc, meta) {\r\n    emit(meta.id, null);\r\n}\r\n<\/code>\r\n<\/pre>\n<p>\n    This view will emit all documents and the key will be each of the documents ids.\n<\/p>\n<h2>Our Node.js Application<\/h2>\n<p>\n    At this point we&#8217;re going to create a fresh Node.js application to keep things easy to understand.\n<\/p>\n<h3>Preparing the Project<\/h3>\n<p>\n    Using your Terminal (Mac \/ Linux) or Command Prompt (Windows), execute the following command:\n<\/p>\n<pre>\r\n<code class=\"language-bash\">\r\nnpm init\r\n<\/code>\r\n<\/pre>\n<p>\n    Answer all the questions and you should be good.  You can also just create your NPM <strong>package.json<\/strong> file from scratch and<br \/>\n    add the following content:\n<\/p>\n<pre>\r\n<code class=\"language-json\">\r\n{\r\n    \"name\": \"mass-delete-nodejs\",\r\n    \"version\": \"1.0.0\",\r\n    \"description\": \"Delete all documents prefixed with a particular value\",\r\n    \"author\": \"Couchbase, Inc.\",\r\n    \"license\": \"MIT\"\r\n}\r\n<\/code>\r\n<\/pre>\n<p>\n    We&#8217;re not done. We need to install the project dependencies before we can start planning out this<br \/>\n    application. From the Command Prompt or Terminal, run the following command:\n<\/p>\n<pre>\r\n<code class=\"language-bash\">\r\nnpm install couchbase express --save\r\n<\/code>\r\n<\/pre>\n<p>\n    This will install Express Framework, and the Couchbase Node.js SDK.\n<\/p>\n<h3>The Code That Matters<\/h3>\n<p>\n    If you haven&#8217;t already, create an <strong>app.js<\/strong> file that sits next to your <strong>package.json<\/strong> file in your project.<br \/>\n    The contect of this file should be as follows:\n<\/p>\n<pre>\r\n<code class=\"language-javascript\">\r\nvar express = require(\"express\");\r\nvar couchbase = require(\"couchbase\");\r\nvar app = express();\r\n\r\nvar bucket = (new couchbase.Cluster(\"https:\/\/127.0.0.1:8091\")).openBucket(\"testbucket\");\r\n\r\nvar ViewQuery = couchbase.ViewQuery;\r\nvar query = ViewQuery.from('docs', 'by_id');\r\n\r\nquery.range(\"user::\", \"user::\" + \"u02ad\", false);\r\n\r\nbucket.query(query, function(error, results) {\r\n    if(error) {\r\n        return console.log(error);\r\n    }\r\n    console.log(\"Found \" + results.length + \" documents to delete\");\r\n    for(i in results) {\r\n        bucket.remove(results[i].id, function(error, result) {\r\n            console.log(\"Deleting \" + results[i].key);\r\n        });\r\n    }\r\n});\r\n\r\nvar server = app.listen(3000, function () {\r\n    console.log(\"Listening on port %s...\", server.address().port);\r\n});\r\n<\/code>\r\n<\/pre>\n<p>\n    There is a lot going on here so I&#8217;m going to break it down.\n<\/p>\n<pre>\r\n<code class=\"language-javascript\">\r\nvar express = require(\"express\");\r\nvar couchbase = require(\"couchbase\");\r\nvar app = express();\r\n<\/code>\r\n<\/pre>\n<p>\n    Not too much to care about above.  We&#8217;re just including the Couchbase SDK and Express Framework for use in our application.  However, below<br \/>\n    you&#8217;ll see that we are connecting to our cluster and opening a particular bucket:\n<\/p>\n<pre>\r\n<code class=\"language-javascript\">\r\nvar bucket = (new couchbase.Cluster(\"https:\/\/127.0.0.1:8091\")).openBucket(\"testbucket\");\r\n<\/code>\r\n<\/pre>\n<p>\n    We&#8217;re connecting to a locally hosted Couchbase instance and opening our <strong>testbucket<\/strong> mentioned earlier.\n<\/p>\n<p>\n    Now we&#8217;re going to look at something great!\n<\/p>\n<pre>\r\n<code class=\"language-javascript\">\r\nvar ViewQuery = couchbase.ViewQuery;\r\nvar query = ViewQuery.from('docs', 'by_id');\r\n\r\nquery.range(\"user::\", \"user::\" + \"u02ad\", false);\r\n<\/code>\r\n<\/pre>\n<p>\n    We are preparing a ViewQuery object from our <strong>_design\/dev_docs<\/strong> design document and <strong>by_id<\/strong> view.  To only query<br \/>\n    for particular documents we&#8217;re going to use what is called a range query.  We already know that our view is returning documents with the<br \/>\n    document id as the key value.  This means with a range query we can determine what keys we want to receive.\n<\/p>\n<p>\n    In the range query, the start key will be <strong>user::<\/strong> because we want to delete all user documents.  The end key will also<br \/>\n    contain <strong>user::<\/strong>, but have the unicode character <strong>u02ad<\/strong> appended to it.  This will capture everything<br \/>\n    prefixed with what we&#8217;re looking for.  More information on this type of range query can be seen in the<br \/>\n    <a href=\"https:\/\/docs.couchbase.com\/admin\/admin\/Views\/views-querying.html\">official Couchbase documentation<\/a>.\n<\/p>\n<p>\n    Finally we execute this query and capture the results.  The results are looped through and we will delete every record one by one as seen<br \/>\n    in the following:\n<\/p>\n<pre>\r\n<code class=\"language-javascript\">\r\nfor(i in results) {\r\n    bucket.remove(results[i].id, function(error, result) {\r\n        console.log(\"Deleting \" + results[i].key);\r\n    });\r\n}\r\n<\/code>\r\n<\/pre>\n<p>\n    Every delete issued in Node.js will be non-blocking so the application layer won&#8217;t lock up. When a delete request hits Couchbase Server,<br \/>\n    the document is then marked for deletion and is then later deleted when compaction happens.\n<\/p>\n<pre>\r\n<code class=\"language-bash\">\r\nnode app.js\r\n<\/code>\r\n<\/pre>\n<p>\n    Run the above line to see this project in action.\n<\/p>\n<h2>Conclusion<\/h2>\n<p>\n    Using range queries you can query for particular documents in a view and then choose to delete them.  The particular documents in this example<br \/>\n    had compound keys prefixed with <strong>user::<\/strong> in the key.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common question that gets asked in the Couchbase forums and on Stack Overflow is how to delete all records from a bucket that have a key that starts with some value. In other words, how to delete all records [&hellip;]<\/p>\n","protected":false},"author":63,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1822],"tags":[1241],"ppma_author":[9032],"class_list":["post-2081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-node-js","tag-views"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Mass Deleting Documents by Compound Key Prefix Using Node.js - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mass Deleting Documents by Compound Key Prefix Using Node.js\" \/>\n<meta property=\"og:description\" content=\"A common question that gets asked in the Couchbase forums and on Stack Overflow is how to delete all records from a bucket that have a key that starts with some value. In other words, how to delete all records [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/thepolyglotdeveloper\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-31T15:00:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T06:47:48+00:00\" \/>\n<meta name=\"author\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nraboy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Mass Deleting Documents by Compound Key Prefix Using Node.js\",\"datePublished\":\"2015-07-31T15:00:01+00:00\",\"dateModified\":\"2025-06-14T06:47:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/\"},\"wordCount\":823,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"views\"],\"articleSection\":[\"Node.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/\",\"name\":\"Mass Deleting Documents by Compound Key Prefix Using Node.js - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-07-31T15:00:01+00:00\",\"dateModified\":\"2025-06-14T06:47:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mass Deleting Documents by Compound Key Prefix Using Node.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\",\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"caption\":\"Nic Raboy, Developer Advocate, Couchbase\"},\"description\":\"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.\",\"sameAs\":[\"https:\/\/www.thepolyglotdeveloper.com\",\"https:\/\/www.facebook.com\/thepolyglotdeveloper\",\"https:\/\/x.com\/nraboy\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/nic-raboy-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Mass Deleting Documents by Compound Key Prefix Using Node.js - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/","og_locale":"en_US","og_type":"article","og_title":"Mass Deleting Documents by Compound Key Prefix Using Node.js","og_description":"A common question that gets asked in the Couchbase forums and on Stack Overflow is how to delete all records from a bucket that have a key that starts with some value. In other words, how to delete all records [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2015-07-31T15:00:01+00:00","article_modified_time":"2025-06-14T06:47:48+00:00","author":"Nic Raboy, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@nraboy","twitter_misc":{"Written by":"Nic Raboy, Developer Advocate, Couchbase","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Mass Deleting Documents by Compound Key Prefix Using Node.js","datePublished":"2015-07-31T15:00:01+00:00","dateModified":"2025-06-14T06:47:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/"},"wordCount":823,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["views"],"articleSection":["Node.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/","url":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/","name":"Mass Deleting Documents by Compound Key Prefix Using Node.js - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2015-07-31T15:00:01+00:00","dateModified":"2025-06-14T06:47:48+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/mass-deleting-documents-by-compound-key-prefix-using-node-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Mass Deleting Documents by Compound Key Prefix Using Node.js"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1","name":"Nic Raboy, Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354","url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","caption":"Nic Raboy, Developer Advocate, Couchbase"},"description":"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.","sameAs":["https:\/\/www.thepolyglotdeveloper.com","https:\/\/www.facebook.com\/thepolyglotdeveloper","https:\/\/x.com\/nraboy"],"url":"https:\/\/www.couchbase.com\/blog\/author\/nic-raboy-2\/"}]}},"authors":[{"term_id":9032,"user_id":63,"is_guest":0,"slug":"nic-raboy-2","display_name":"Nic Raboy, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","author_category":"","last_name":"Raboy","first_name":"Nic","job_title":"","user_url":"https:\/\/www.thepolyglotdeveloper.com","description":"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2081"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2081\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2081"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}