{"id":12739,"date":"2022-01-31T14:19:50","date_gmt":"2022-01-31T22:19:50","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=12739"},"modified":"2025-10-16T11:38:57","modified_gmt":"2025-10-16T18:38:57","slug":"quickstart-connect-to-couchbase-capella-using-node-js","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/","title":{"rendered":"Quickstart: Connect to Couchbase Capella using Node.JS"},"content":{"rendered":"<p>Interested in connecting to a Capella cluster using Node.js?<\/p>\n<p>In this quickstart blog post (and I do mean quick!) I will walk you through the short set of steps to connect to a cluster in <a href=\"https:\/\/www.couchbase.com\/products\/capella\/\">Capella<\/a> with the Couchbase Node.js SDK.<\/p>\n<h4>Setup<\/h4>\n<h5>Requirements<\/h5>\n<p>To complete this tutorial, you must have the following:<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/cloud.couchbase.com\/sign-up\"><span style=\"font-weight: 400;\">A Couchbase Capella account<\/span><\/a><span style=\"font-weight: 400;\"> &#8211; free trials are available with a simple sign-up<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Capella Cluster <\/span><a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/deploy-first-cluster.html\"><span style=\"font-weight: 400;\">deployed<\/span><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/configure-cluster-access.html\"><span style=\"font-weight: 400;\">configured for access<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/docs.npmjs.com\/downloading-and-installing-node-js-and-npm\">npm<\/a> &#8211; Node.js package manager<\/li>\n<\/ul>\n<h5>Install latest long-term support (LTS) release of <a href=\"https:\/\/nodejs.org\/en\/download\/\">Node.<\/a><\/h5>\n<p>Download and install Node&#8217;s latest long-term support (LTS) release if you haven&#8217;t already.<\/p>\n<p><span style=\"font-weight: 400;\">If you\u2019re installing Node for the first time, we recommend using the <\/span><a href=\"https:\/\/github.com\/nvm-sh\/nvm\"><span style=\"font-weight: 400;\">Node Version Manager (nvm)<\/span><\/a><span style=\"font-weight: 400;\"> for getting started with Node.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Follow the instructions for <\/span><a href=\"https:\/\/github.com\/nvm-sh\/nvm#installation-and-update\"><span style=\"font-weight: 400;\">installing nvm<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Install the latest Node LTS release<\/span><\/li>\n<\/ol>\n<pre class=\"\">$ nvm install --lts<\/pre>\n<h5>Create a Node.JS Project<\/h5>\n<p>Creating a Node.js project is as easy as making a directory and initializing it with npm. The next two commands will do that for us. Open up a terminal and run the following command:<\/p>\n<pre class=\"\">$ mkdir node-couchbase-project &amp;&amp; cd $_<\/pre>\n<p>The command above will make our directory and change our current working directory. The next command initializes the project directory:<\/p>\n<pre class=\"\">$ npm init -y<\/pre>\n<p>If a directory does not already have a <em>package.json<\/em> at its root, this means it is not initialized. The command above will accomplish this.<\/p>\n<p>Note: We have used the<em> -y<\/em> flag to take the initialization defaults. To change any of these defaults, just open the <em>package.json<\/em> and manually make any changes.<\/p>\n<pre class=\"\">{\r\n\"name\": \"node-couchbase-project\",\r\n\"version\": \"1.0.0\",\r\n\"description\": \"\",\r\n\"main\": \"index.js\",\r\n\"scripts\": {\r\n\"test\": \"echo \\\"Error: no test specified\\\" &amp;&amp; exit 1\"\r\n},\r\n\"keywords\": [],\r\n\"author\": \"\",\r\n\"license\": \"ISC\"\r\n}<\/pre>\n<h5>Install the Couchbase Node.js SDK<\/h5>\n<p>The Couchbase Node.js SDK enables you to interact with a Couchbase Server cluster from the Node.js language. The Couchbase Node.js Client will run on any <a href=\"https:\/\/nodejs.org\/en\/download\/\">supported LTS version of Node.js<\/a>.<\/p>\n<p>To install the latest Couchbase Node.js SDK, run the following command:<\/p>\n<pre class=\"\">$ npm install couchbase --save<\/pre>\n<p>Use the <em>&#8211;save<\/em> option to have the Couchbase module added as a dependency to the project. This will help automate the installation of packages if you want to distribute your work in the future.<\/p>\n<h4>Connecting to Couchbase with built-in Node.js SDK<\/h4>\n<p>After <a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/connect-to-cluster.html#install-couchbase-sdk\">installing the Couchbase SDK<\/a>, the next step is to use the built-in SDK examples to connect to your cluster.<\/p>\n<h5>Find cluster connection settings<\/h5>\n<p>Go to the cluster\u2019s Connect tab in the Couchbase Capella UI using these steps:<\/p>\n<ul>\n<li>Go to the Clusters tab in the main navigation<\/li>\n<li>Find and click on your cluster (docs-cluster13feb1 in the following screenshot). This opens the cluster with its Overview tab selected.<\/li>\n<li>Click the Connect tab in the left sidebar<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12740\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/01\/findcluster.png\" alt=\"\" width=\"1600\" height=\"900\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/findcluster.png 1600w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/findcluster-300x169.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/findcluster-1024x576.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/findcluster-768x432.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/findcluster-1536x864.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/findcluster-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/findcluster-1320x743.png 1320w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p>In the Connection section, two endpoints are listed: One labeled <em>Public<\/em> and one labeled<em> Private<\/em>.<\/p>\n<p>When connecting to the cluster over a wide area network\u2014such as when you\u2019re connecting to the cluster over the Internet from an application on your laptop\u2014you will use the public endpoint.<\/p>\n<p>When connecting to the cluster from within your cloud provider using a peering connection, you will use the private endpoint.<\/p>\n<p>However, you will not need to copy the public endpoint for this post because it is automatically included in the built-in SDK examples we will use.<\/p>\n<h4>Open SDK examples<\/h4>\n<p>Click SDK Examples. This opens the SDK Examples fly-out menu, showing the options in this screenshot:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12741\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/01\/sdkexamples.png\" alt=\"\" width=\"1048\" height=\"1200\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/sdkexamples.png 1048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/sdkexamples-262x300.png 262w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/sdkexamples-894x1024.png 894w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/sdkexamples-768x879.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/sdkexamples-300x344.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/01\/sdkexamples-17x20.png 17w\" sizes=\"auto, (max-width: 1048px) 100vw, 1048px\" \/><\/p>\n<p>Each of the supported Couchbase SDK languages is represented by a tab. Under each tab, a snippet of the example code is provided. The example code is pre-populated with the cluster\u2019s public endpoint and, with a few modifications, can quickly be used for connecting to the cluster.<\/p>\n<h5>Copy the example code.<\/h5>\n<p>Click on the tab for your desired SDK language, and copy the example code. If you\u2019re following the examples in this guide, click the Node.js tab, and copy the example JavaScript code.<\/p>\n<p>Paste the example code into a text editor and update your connection details.<\/p>\n<p>The SDK example code automatically comes pre-populated with the cluster\u2019s public endpoint and default bucket name.<\/p>\n<p>Update the <em>username<\/em> and <em>password<\/em> connection settings to the database credentials you created when <span style=\"font-weight: 400;\">you <\/span><a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/configure-cluster-access.html#configure-database-access\"><span style=\"font-weight: 400;\">configured database access<\/span><\/a><span style=\"font-weight: 400;\"> earlier.<\/span><\/p>\n<h5>Changing the bucket (optional)<\/h5>\n<p>The <em>bucketName<\/em> is the name of a bucket on the cluster you will connect to. The example code comes pre-populated with the name of the default bucket: <em>couchbasecloudbucket<\/em>. This bucket will suffice for this tutorial, but if you choose <span style=\"font-weight: 400;\">to <\/span><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/data-service\/manage-buckets.html\"><span style=\"font-weight: 400;\">create a new bucket<\/span><\/a><span style=\"font-weight: 400;\"> for this exercise, you\u2019ll need to specify the new bucket\u2019s name in the example code.<\/span><\/p>\n<p>Database credentials must allow access to any new bucket that you add. If you configured the database credential to have read\/write permissions on all buckets (as recommended), you can specify any bucket when testing out the connection.<\/p>\n<p>The following is an example of a completed Node.js configuration:<\/p>\n<pre class=\"\">var couchbase = require('couchbase');\r\n\r\n\/\/ Update this to your cluster\r\n\r\nconst endpoint = '408f6eee-c52d-4d44-a155-691f9c511931.dataplane.couchbase.com'\r\nconst username = 'admin'\r\nconst password = 'P@ssw0rd'\r\nconst bucketName = 'couchbasecloudbucket'\r\n\r\n\/\/ User Input ends here.\r\n\r\n\/\/ Initialize the Connection\r\nvar cluster = new couchbase.Cluster('couchbases:\/\/' +endpoint+'?ssl=no_verify&amp;console_log_level=5', {username: username, password: password});\r\nvar bucket = cluster.bucket(bucketName);\r\nvar collection = bucket.defaultCollection();\r\n\r\nfunction start(){\r\nconsole.log('start');\r\nreturn new Promise( (resolve, reject) =&gt; { resolve(); });\r\n}\r\n\r\nasync function run(){\r\n\/\/ Create a N1QL Primary Index (but ignore if it exists)\r\ntry {\r\nawait cluster.queryIndexes().createPrimaryIndex(bucketName, {ignoreExists: true});\r\n} catch (e) {\r\n}\r\n\r\n\/\/ Create and store a document\r\ntry {\r\nawait collection.upsert('user:king_arthur', {\r\n'name': 'Arthur', 'email': 'kingarthur@couchbase.com', 'interests': ['Holy Grail', 'African Swallows']\r\n});\r\n} catch (e) {\r\nthrow(e);\r\n}\r\n\r\n\/\/ Load the Document and print it\r\n\/\/ Prints Content and Metadata of the stored Document\r\ntry {\r\nlet getResult = await collection .get('user:king_arthur');\r\nconsole.log('Got: ');\r\nconsole.log(getResult);\r\n} catch (e) {\r\nconsole.log(e);\r\nthrow(e);\r\n}\r\n\r\n\/\/ Perform a N1QL Query\r\nconst options = { parameters: ['African Swallows'] };\r\ntry {\r\nlet queryResult = await cluster.query('SELECT name FROM '+bucketName +' WHERE $1 in interests LIMIT 1', options);\r\nqueryResult.rows.forEach((row) =&gt; {\r\nconsole.log('Query row: ', row)\r\n});\r\n} catch (e) {\r\nconsole.log(e);\r\nthrow(e);\r\n}\r\n}\r\nstart().then(run).then(() =&gt; { console.log(\"closing...\"); cluster.close();});<\/pre>\n<p>Once you\u2019ve finished updating the example code with your connection details, save it in your project directory. Be sure to use the appropriate file extension for the SDK language.<\/p>\n<p>If you\u2019re following the examples in this guide, save the file as <em>connection-script.js<\/em> in the <em>node-couchbase-project<\/em> directory that you created earlier when you installed the Couchbase Node.js SDK.<\/p>\n<h5>Connect to the cluster.<\/h5>\n<p>From the project directory, run the connection script using the following command:<\/p>\n<pre class=\"\">node connection-script.js<\/pre>\n<p>The results you should expect are as follows:<\/p>\n<pre class=\"\">Got:\r\n{\r\ncas: CbCas { '0': &lt;Buffer 08 00 64 71 50 c3 25 16&gt; },\r\nvalue: {\r\nname: 'Arthur',\r\nemail: 'kingarthur@couchbase.com',\r\ninterests: [ 'Holy Grail', 'African Swallows' ]\r\n}\r\n}\r\nQuery row: { name: 'Arthur' }<\/pre>\n<p>If you received the results above, the connection was successful, and a document was written to the bucket.<\/p>\n<p>Congratulations on completing this quickstart guide! Be sure to try this out on Couchbase Capella to see how easy it can be.<\/p>\n<h4><span style=\"font-weight: 400;\">Resources<\/span><\/h4>\n<h5><span style=\"font-weight: 400;\">Capella<\/span><\/h5>\n<p><span style=\"font-weight: 400;\">To learn more about <\/span><a href=\"https:\/\/www.couchbase.com\/products\/capella\/\"><span style=\"font-weight: 400;\">Couchbase Capella<\/span><\/a><span style=\"font-weight: 400;\">, our database-as-a-service offering:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Sign up for a <\/span><a href=\"https:\/\/cloud.couchbase.com\/?href=Playground\"><span style=\"font-weight: 400;\">free 30-day trial<\/span><\/a><span style=\"font-weight: 400;\"> if you haven&#8217;t already<\/span><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/cloud.couchbase.com\/sign-up\"><span style=\"font-weight: 400;\">Connect your trial cluster to the Playground<\/span><\/a><span style=\"font-weight: 400;\"> or connect a project to test it out for yourself<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Take a look at the <\/span><a href=\"https:\/\/developer.couchbase.com\/learn\/capella\"><span style=\"font-weight: 400;\">Capella Learning Path<\/span><\/a><span style=\"font-weight: 400;\">!<\/span><\/li>\n<\/ul>\n<h5><span style=\"font-weight: 400;\">Tutorials<\/span><\/h5>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/www.couchbase.com\/developers\/\"><span style=\"font-weight: 400;\">Couchbase Developer Portal<\/span><\/a><span style=\"font-weight: 400;\"> has tons of <\/span><a href=\"https:\/\/developer.couchbase.com\/tutorials\"><span style=\"font-weight: 400;\">tutorials\/quickstart guides<\/span><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/developer.couchbase.com\/learn\"><span style=\"font-weight: 400;\">learning paths<\/span><\/a><span style=\"font-weight: 400;\"> to help you get started, including:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/developer.couchbase.com\/tutorial-quickstart-nodejs\"><span style=\"font-weight: 400;\">Node.js and Express Tutorial<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/developer.couchbase.com\/tutorial-quickstart-ottomanjs\"><span style=\"font-weight: 400;\">Ottoman.js and Express Tutorial<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/developer.couchbase.com\/tutorial-quickstart-nextjs\"><span style=\"font-weight: 400;\">Next.js Tutorial<\/span><\/a><\/li>\n<\/ul>\n<h5><span style=\"font-weight: 400;\">Training<\/span><\/h5>\n<p><span style=\"font-weight: 400;\">We have several training options available depending on your need and level:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/learn.couchbase.com\/store\/2385919-cb130n-couchbase-associate-node-js-developer-certification-course-v7\"><span style=\"font-weight: 400;\">Associate Node.js Developer course<\/span><\/a><span style=\"font-weight: 400;\"> (free)<\/span><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/learn.couchbase.com\/store\/2358679-cb131-couchbase-associate-architect-certification-course-v7\"><span style=\"font-weight: 400;\">Associate Architect course<\/span><\/a><span style=\"font-weight: 400;\"> &#8211; language-agnostic<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All training options <\/span><a href=\"https:\/\/www.couchbase.com\/academy\/\"><span style=\"font-weight: 400;\">here<\/span><\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/docs.couchbase.com\/home\/sdk.html\"><span style=\"font-weight: 400;\">See the documentation<\/span><\/a><span style=\"font-weight: 400;\"> to learn more about the Couchbase SDKs.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">____________________________________________________________________________<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Thank you for reading this post. At this point, you should be able to easily interact with a Couchbase Capella cluster from a Node.js script. If you have any questions or comments, please connect with us on the <\/span><a href=\"https:\/\/www.couchbase.com\/forums\/\"><span style=\"font-weight: 400;\">Couchbase <\/span><\/a><span style=\"font-weight: 400;\">Forums.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Interested in connecting to a Capella cluster using Node.js? In this quickstart blog post (and I do mean quick!) I will walk you through the short set of steps to connect to a cluster in Capella with the Couchbase Node.js [&hellip;]<\/p>\n","protected":false},"author":82066,"featured_media":12109,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[2225,1822,2201],"tags":[],"ppma_author":[9657],"class_list":["post-12739","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-node-js","category-tools-sdks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.2 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Quickstart: Connect to Couchbase Capella 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\/quickstart-connect-to-couchbase-capella-using-node-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quickstart: Connect to Couchbase Capella using Node.JS\" \/>\n<meta property=\"og:description\" content=\"Interested in connecting to a Capella cluster using Node.js? In this quickstart blog post (and I do mean quick!) I will walk you through the short set of steps to connect to a cluster in Capella with the Couchbase Node.js [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-31T22:19:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-16T18:38:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Couchbase Product Marketing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Couchbase Product Marketing\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/\"},\"author\":{\"name\":\"Couchbase Product Marketing\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/befa2a9de827aed2f8354f939cd6598e\"},\"headline\":\"Quickstart: Connect to Couchbase Capella using Node.JS\",\"datePublished\":\"2022-01-31T22:19:50+00:00\",\"dateModified\":\"2025-10-16T18:38:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/\"},\"wordCount\":1077,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg\",\"articleSection\":[\"Couchbase Capella\",\"Node.js\",\"Tools &amp; SDKs\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/\",\"name\":\"Quickstart: Connect to Couchbase Capella using Node.JS - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg\",\"datePublished\":\"2022-01-31T22:19:50+00:00\",\"dateModified\":\"2025-10-16T18:38:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg\",\"width\":1200,\"height\":628,\"caption\":\"Learn how to create full-text search indexes for Couchbase Server 7.0 using Scopes and Collections\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quickstart: Connect to Couchbase Capella 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\/befa2a9de827aed2f8354f939cd6598e\",\"name\":\"Couchbase Product Marketing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5112ed57023bd2807ae7086c2fe68752\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4760a19fc4ed6b8b830ba98f0869ed0d8ee6729e2593881e1a68032b9c281d5d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4760a19fc4ed6b8b830ba98f0869ed0d8ee6729e2593881e1a68032b9c281d5d?s=96&d=mm&r=g\",\"caption\":\"Couchbase Product Marketing\"},\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/couchbase-pmm\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Quickstart: Connect to Couchbase Capella 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\/quickstart-connect-to-couchbase-capella-using-node-js\/","og_locale":"en_US","og_type":"article","og_title":"Quickstart: Connect to Couchbase Capella using Node.JS","og_description":"Interested in connecting to a Capella cluster using Node.js? In this quickstart blog post (and I do mean quick!) I will walk you through the short set of steps to connect to a cluster in Capella with the Couchbase Node.js [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-01-31T22:19:50+00:00","article_modified_time":"2025-10-16T18:38:57+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg","type":"image\/jpeg"}],"author":"Couchbase Product Marketing","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Couchbase Product Marketing","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/"},"author":{"name":"Couchbase Product Marketing","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/befa2a9de827aed2f8354f939cd6598e"},"headline":"Quickstart: Connect to Couchbase Capella using Node.JS","datePublished":"2022-01-31T22:19:50+00:00","dateModified":"2025-10-16T18:38:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/"},"wordCount":1077,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg","articleSection":["Couchbase Capella","Node.js","Tools &amp; SDKs"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/","url":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/","name":"Quickstart: Connect to Couchbase Capella using Node.JS - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg","datePublished":"2022-01-31T22:19:50+00:00","dateModified":"2025-10-16T18:38:57+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/11\/how-to-create-full-text-search-indexes-couchbase-server-7-0.jpg","width":1200,"height":628,"caption":"Learn how to create full-text search indexes for Couchbase Server 7.0 using Scopes and Collections"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/quickstart-connect-to-couchbase-capella-using-node-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Quickstart: Connect to Couchbase Capella 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\/befa2a9de827aed2f8354f939cd6598e","name":"Couchbase Product Marketing","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5112ed57023bd2807ae7086c2fe68752","url":"https:\/\/secure.gravatar.com\/avatar\/4760a19fc4ed6b8b830ba98f0869ed0d8ee6729e2593881e1a68032b9c281d5d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4760a19fc4ed6b8b830ba98f0869ed0d8ee6729e2593881e1a68032b9c281d5d?s=96&d=mm&r=g","caption":"Couchbase Product Marketing"},"url":"https:\/\/www.couchbase.com\/blog\/author\/couchbase-pmm\/"}]}},"authors":[{"term_id":9657,"user_id":82066,"is_guest":0,"slug":"couchbase-pmm","display_name":"Couchbase Product Marketing","avatar_url":{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/06\/image_2022-06-17_105452255.png","url2x":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/06\/image_2022-06-17_105452255.png"},"author_category":"","last_name":"","first_name":"Couchbase Product Marketing","job_title":"","user_url":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/12739","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\/82066"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=12739"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/12739\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/12109"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=12739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=12739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=12739"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=12739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}