{"id":3974,"date":"2017-10-02T07:00:08","date_gmt":"2017-10-02T14:00:08","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=3974"},"modified":"2023-09-09T02:30:23","modified_gmt":"2023-09-09T09:30:23","slug":"create-restful-api-node-js-hapi-couchbase-nosql","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/","title":{"rendered":"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL"},"content":{"rendered":"<p>Developing Node.js applications with Express is no doubt a very popular option, however it isn&#8217;t the only option and it may not even be the best option. I recently started looking into <a href=\"https:\/\/hapijs.com\/\" target=\"_blank\" rel=\"noopener\">Hapi<\/a> which defines itself as being a framework for services, something that wasn&#8217;t exactly a thing when Express came around.<\/p>\n<p>Previously I had written about <a href=\"https:\/\/www.thepolyglotdeveloper.com\/2015\/10\/create-a-full-stack-app-using-node-js-couchbase-server\/\" target=\"_blank\" rel=\"noopener\">creating a RESTful API with Node.js and Express<\/a>, but this time around we&#8217;re going to explore doing the same with Hapi.<\/p>\n<p><!--more--><\/p>\n<p>Before we get too invested in the code, we need to figure out what exactly we&#8217;re going to be building. The goal here is to create a two endpoint application. One endpoint should allow us to create data in the database and the other should allow us to read from the database.<\/p>\n<p>Create a new project directory somewhere on your computer and execute the following command from the command prompt within that directory:<\/p>\n<pre class=\"lang:default decode:true \">npm init -y<\/pre>\n<p>The above command will create a new Node.js project by establishing a\u00a0<strong>package.json<\/strong> file. The next step is to install each of the project dependencies.<\/p>\n<p>Execute the following from the command line:<\/p>\n<pre class=\"lang:default decode:true\">npm install couchbase hapi joi uuid --save<\/pre>\n<p>The above command will download the Couchbase Node.js SDK, the Hapi framework, Joi for data validation, and a package for generating UUID values to represent our NoSQL document keys.<\/p>\n<p>Go ahead and create an\u00a0<strong>app.js<\/strong> file within your project. This is where we will have all of our routing information and database logic. Open this\u00a0<strong>app.js<\/strong> file and include the following JavaScript code:<\/p>\n<pre class=\"lang:default decode:true \">const Hapi = require(\"hapi\");\r\nconst Couchbase = require(\"couchbase\");\r\nconst UUID = require(\"uuid\");\r\nconst Joi = require(\"joi\");\r\n\r\nconst server = new Hapi.Server();\r\nconst N1qlQuery = Couchbase.N1qlQuery;\r\n\r\nconst cluster = new Couchbase.Cluster(\"https:\/\/localhost\");\r\nconst bucket = cluster.openBucket(\"default\", \"\");\r\n\r\nserver.connection({ \"host\": \"localhost\", \"port\": 3000 });\r\n\r\nserver.route({\r\n    method: \"GET\",\r\n    path: \"\/\",\r\n    handler: (request, response) =&gt; {\r\n        return response(\"Hello World\");\r\n    }\r\n});\r\n\r\nserver.start(error =&gt; {\r\n    if(error) {\r\n        throw error;\r\n    }\r\n    console.log(\"Listening at \" + server.info.uri);\r\n});<\/pre>\n<p>The above code will get us started. It imports each of our project dependencies, initializes Hapi for a specific host and port, and establishes a connection to Couchbase. We have also defined a single route to represent our root route.<\/p>\n<p>For this example, Couchbase will be running locally and we&#8217;ll be using a Bucket called <code>default<\/code>. For information on installing Couchbase, check out my tutorials for <a href=\"https:\/\/www.youtube.com\/watch?v=L1wNemXGd9Q\" target=\"_blank\" rel=\"noopener\">Mac<\/a>, <a href=\"https:\/\/www.youtube.com\/watch?v=z8BcuXDJrDY\" target=\"_blank\" rel=\"noopener\">Linux<\/a>, and <a href=\"https:\/\/www.youtube.com\/watch?v=dZpnANelV2M\" target=\"_blank\" rel=\"noopener\">Windows<\/a>.<\/p>\n<p>Now we can worry about our two endpoints that interact with the database.<\/p>\n<p>The first and probably simplest endpoint will be for returning a list of documents, in this case people that had previously been created:<\/p>\n<pre class=\"lang:default decode:true \">server.route({\r\n    method: \"GET\",\r\n    path: \"\/people\",\r\n    handler: (request, response) =&gt; {\r\n        var statement = \"SELECT `\" + bucket._name + \"`.* FROM `\" + bucket._name + \"` WHERE type = 'person'\";\r\n        var query = N1qlQuery.fromString(statement);\r\n        bucket.query(query, (error, result) =&gt; {\r\n            if(error) {\r\n                return response(error).code(500);\r\n            }\r\n            return response(result);\r\n        });\r\n    }\r\n});<\/pre>\n<p>Notice the <code>handler<\/code> method. In it we construct a N1QL query that obtains all documents that have a <code>type<\/code> property that matches <code>person<\/code>. This means that we can have plenty of other document types that won&#8217;t be picked up by our query.<\/p>\n<p>If there is a problem with the query, we will return an error with a 500 response code, otherwise we&#8217;ll return the query results.<\/p>\n<p>The next endpoint is where we make use of Joi for data validation. Check out the following JavaScript code:<\/p>\n<pre class=\"lang:default decode:true \">server.route({\r\n    method: \"POST\",\r\n    path: \"\/person\",\r\n    config: {\r\n        validate: {\r\n            payload: {\r\n                firstname: Joi.string().required(),\r\n                lastname: Joi.string().required(),\r\n                type: Joi.any().forbidden().default(\"person\"),\r\n                timestamp: Joi.any().forbidden().default((new Date()).getTime())\r\n            }\r\n        }\r\n    },\r\n    handler: (request, response) =&gt; {\r\n        bucket.insert(UUID.v4(), request.payload, (error, result) =&gt; {\r\n            if(error) {\r\n                return response(error).code(500);\r\n            }\r\n            return response(request.payload);\r\n        });\r\n    }\r\n});<\/pre>\n<p>When a client tries to consume from this endpoint, validation happens as part of Hapi. In this validation process we inspect the payload and make sure each of our properties meet the criteria. In this case both <code>firstname<\/code> and <code>lastname<\/code> need to be present. It is forbidden for a <code>type<\/code> and <code>timestamp<\/code> property to exist in the request body. If they exist, and error will be returned. If they do not exist, a default value will be used.<\/p>\n<p>If our validation passes, we can insert the data into Couchbase with a unique id. The data will also be returned in the response.<\/p>\n<h2>Conclusion<\/h2>\n<p>You just saw how to create a very simple RESTful API with Hapi and <a href=\"https:\/\/www.couchbase.com\" target=\"_blank\" rel=\"noopener\">Couchbase Server<\/a>. I&#8217;ve been using Express since the beginning, but when it comes to Hapi, I feel like it was much better designed for creating web services. However, both will get the job done and if you&#8217;d like to see an Express alternative, check out this <a href=\"https:\/\/www.thepolyglotdeveloper.com\/2015\/10\/create-a-full-stack-app-using-node-js-couchbase-server\/\" target=\"_blank\" rel=\"noopener\">previous tutorial<\/a> I wrote.<\/p>\n<p>For more information on using Couchbase with Node.js, check out the <a href=\"https:\/\/www.couchbase.com\/developers\/\" target=\"_blank\" rel=\"noopener\">Couchbase Developer Portal<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Developing Node.js applications with Express is no doubt a very popular option, however it isn&#8217;t the only option and it may not even be the best option. I recently started looking into Hapi which defines itself as being a framework [&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":[1814,1815,1816,1822],"tags":[1393,1745],"ppma_author":[9032],"class_list":["post-3974","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-best-practices-and-tutorials","category-couchbase-server","category-node-js","tag-api","tag-restful"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.0 (Yoast SEO v26.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL<\/title>\n<meta name=\"description\" content=\"Learn how to create a RESTful API with Couchbase NoSQL, N1QL, and the efficient Hapi framework for Node.js\" \/>\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\/create-restful-api-node-js-hapi-couchbase-nosql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a RESTful API with Couchbase NoSQL, N1QL, and the efficient Hapi framework for Node.js\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/\" \/>\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=\"2017-10-02T14:00:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-09T09:30:23+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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL\",\"datePublished\":\"2017-10-02T14:00:08+00:00\",\"dateModified\":\"2023-09-09T09:30:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/\"},\"wordCount\":638,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"API\",\"restful\"],\"articleSection\":[\"Application Design\",\"Best Practices and Tutorials\",\"Couchbase Server\",\"Node.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/\",\"name\":\"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-10-02T14:00:08+00:00\",\"dateModified\":\"2023-09-09T09:30:23+00:00\",\"description\":\"Learn how to create a RESTful API with Couchbase NoSQL, N1QL, and the efficient Hapi framework for Node.js\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#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\/create-restful-api-node-js-hapi-couchbase-nosql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL\"}]},{\"@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":"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL","description":"Learn how to create a RESTful API with Couchbase NoSQL, N1QL, and the efficient Hapi framework for Node.js","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\/create-restful-api-node-js-hapi-couchbase-nosql\/","og_locale":"en_US","og_type":"article","og_title":"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL","og_description":"Learn how to create a RESTful API with Couchbase NoSQL, N1QL, and the efficient Hapi framework for Node.js","og_url":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2017-10-02T14:00:08+00:00","article_modified_time":"2023-09-09T09:30:23+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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL","datePublished":"2017-10-02T14:00:08+00:00","dateModified":"2023-09-09T09:30:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/"},"wordCount":638,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["API","restful"],"articleSection":["Application Design","Best Practices and Tutorials","Couchbase Server","Node.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/","url":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/","name":"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-10-02T14:00:08+00:00","dateModified":"2023-09-09T09:30:23+00:00","description":"Learn how to create a RESTful API with Couchbase NoSQL, N1QL, and the efficient Hapi framework for Node.js","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/create-restful-api-node-js-hapi-couchbase-nosql\/#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\/create-restful-api-node-js-hapi-couchbase-nosql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL"}]},{"@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\/3974","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=3974"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3974\/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=3974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=3974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=3974"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}