{"id":10247,"date":"2026-02-12T23:44:27","date_gmt":"2026-02-13T07:44:27","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/cxx-quickstart\/"},"modified":"2026-02-12T23:44:27","modified_gmt":"2026-02-13T07:44:27","slug":"cxx-quickstart","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/","title":{"rendered":"Quickstart in Couchbase with C++"},"content":{"rendered":"\n<h3 id=\"h-introduction\" class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents, how to write simple parameterized SQL++ queries, and how to create and perform simple and complex search operations using Search indexes.<\/p>\n\n\n\n<h3 id=\"h-prerequisites\" class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To run this prebuilt project, you will need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><a href=\"https:\/\/www.couchbase.com\/products\/capella\/\">Couchbase Capella<\/a> cluster or a self managed Couchbase cluster with <a href=\"https:\/\/docs.couchbase.com\/python-sdk\/current\/ref\/travel-app-data-model.html\">travel-sample<\/a> bucket loaded.<\/p>\n<\/li>\n\n\n<li>\n<p><a href=\"https:\/\/cmake.org\/\">CMake<\/a> 3.9 or higher installed<\/p>\n<\/li>\n\n\n<li>\n<p><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/17\">C++17<\/a> and a compatible compiler, <a href=\"https:\/\/clang.llvm.org\/\">clang++<\/a> or <a href=\"https:\/\/gcc.gnu.org\/\">g++<\/a><\/p>\n<\/li>\n\n\n<li>\n<p>Loading Travel Sample Bucket\nIf travel-sample is not loaded in your cluster, you can load it by following the instructions:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/data-service\/import-data-documents.html#import-sample-data\">Load travel-sample bucket in Couchbase Capella<\/a><\/li>\n<li><a href=\"https:\/\/docs.couchbase.com\/server\/current\/getting-started\/do-a-quick-install.html#load-the-sample-dataset\">Load travel-sample bucket in self-managed cluster<\/a><\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-application-setup\" class=\"wp-block-heading\">Application Setup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We will walk through the different steps required to get the application running.<\/p>\n\n\n\n<h4 id=\"h-cloning-repo\" class=\"wp-block-heading\">Cloning Repo<\/h4>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>git clone https:\/\/github.com\/couchbase-examples\/cxx-quickstart.git\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-setup-database-configuration\" class=\"wp-block-heading\">Setup Database Configuration<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To know more about connecting to your Capella cluster, please follow the <a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/connect.html\">instructions<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Specifically, you need to do the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the <a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/manage-database-users.html\">database credentials<\/a> to access the travel-sample bucket (Read and Write) used in the application.<\/li>\n\n\n<li><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/allow-ip-address.html\">Allow access<\/a> to the Cluster from the IP on which the application is running.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">All configuration for communication with the database is read from the environment variables. We have provided a convenience feature in this quickstart to setup the required environment variables using a shell script <code>set_env_vars.sh<\/code>. Change the values of the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>export DB_CONN_STR=&lt;connection_string&gt;\nexport DB_USERNAME=&lt;username&gt;\nexport DB_PASSWORD=&lt;password&gt;\nexport BUCKET_NAME=&lt;bucket_name&gt;\nexport SCOPE_NAME=&lt;inventory&gt;\nexport COL_NAME=&lt;collection_name&gt;\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Note: The connection string expects the <code>couchbases:\/\/<\/code> or <code>couchbase:\/\/<\/code> part.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Run the command:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>source set_env_vars.sh\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will set the environment variables for that session.<\/p>\n\n\n\n<h4 id=\"h-install-dependencies-and-building\" class=\"wp-block-heading\">Install Dependencies and Building<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This project makes use of CMake and CPM to install dependencies.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>mkdir build\ncd build\ncmake ..\ncmake --build .\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will download and install all the dependencies required for the project to be built. Along with that it will build the executable required to run the application.<\/p>\n\n\n\n<h3 id=\"h-running-the-application\" class=\"wp-block-heading\">Running The Application<\/h3>\n\n\n\n<h4 id=\"h-directly-on-machine\" class=\"wp-block-heading\">Directly on Machine<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, we have installed the dependencies, loaded the travel-sample data and configured the application with the credentials. The application is now ready and you can run it by executing the following command from the build directory:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>cmake --build .\n.\/cxx_quickstart\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Note: Run this command from the build directory<\/p>\n<\/blockquote>\n\n\n\n<h4 id=\"h-verifying-the-application\" class=\"wp-block-heading\">Verifying the Application<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Once you run the executable, your terminal should fill up with the results of the executed statements written in the main function of the <code>main.cpp<\/code> and should look something like this:\n<img decoding=\"async\" src=\".\/cli_output.png\" alt=\"image\"><\/p>\n\n\n\n<h4 id=\"h-running-tests\" class=\"wp-block-heading\">Running Tests<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">For running tests, a self-managed cluster is required with travel-sample bucket loaded or you need to update the connection details in the <code>tests\/test.cpp<\/code> file. To run the tests, use the following command from the build directory:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>.\/tests\/u_tests\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-schema-and-usage-overview\" class=\"wp-block-heading\">Schema and Usage Overview<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This quickstart utilizes two collections: <strong>airline<\/strong> and <strong>hotel<\/strong>. The <strong>airline<\/strong> collection is used for CRUD operations, while the <strong>hotel<\/strong> collection is leveraged for Search indexes and Query execution. The schemas for both collections can be found in the <code>model<\/code> folder.<\/p>\n\n\n\n<h3 id=\"h-code-review\" class=\"wp-block-heading\">Code Review<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To begin this tutorial, clone the repo and open it up in the IDE of your choice. Now you can explore how to interact with Couchbase Server using the C++ SDK.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We have separated out the SDK code and the main function. The <code>db.h<\/code> and <code>db.cpp<\/code> contain the declaration and the implementation of utility functions we will use to parse environment variables and create a connection to the cluster. <code>operations.h<\/code> and <code>operations.cpp<\/code> contain all the functions that perform operations on the database. Both <code>db.cpp<\/code> and <code>operations.cpp<\/code> are combined to make a static library. The tests are similarly separated out in the <code>tests<\/code> folder which utilize the library created earlier. The <code>main.cpp<\/code> is the executable which is also built by linking the library and contains code that demonstrates the usage of the functions we defined earlier to interact with the database.<\/p>\n\n\n\n<h4 id=\"h-connecting-to-the-cluster\" class=\"wp-block-heading\">Connecting to the Cluster<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In <code>db.h<\/code>, we include the required header files to work with C++ SDK in order to implement the functions required to initialize the database. In the <code>db.cpp<\/code> we implement the functions that help us connect to the database. We begin by implementing a few utility functions that will help us later. The <code>parseEnvironmentVariables<\/code> serves as a utility to get the values set for a list of environment variables. This enables us to get the connection parameters and credentials set by running <code>source set_env_vars.sh<\/code>. Following this, <code>checkScopeAndColExists<\/code> and <code>checkSearchEnabled<\/code> are implemented to check for the existence of a scope and collection of a given name and to verify if the search service is enabled respectively. Finally we have the InitCluster function which returns the connection objects as a tuple.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/ db.h\n\n...\nstd::vector&lt;std::string&gt; parseEnvironmentVariables(const std::vector&lt;std::string&gt;&amp; keys);\nbool checkScopeAndColExists(couchbase::bucket&amp; bucket, const std::string&amp; scope_name, const std::string&amp; col_name);\nbool checkSearchEnabled(couchbase::cluster&amp; cluster, int min_nodes);\n...\nstd::tuple&lt;couchbase::cluster, couchbase::bucket, couchbase::scope, couchbase::collection&gt; InitCluster();\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We recommend creating a single Couchbase connection when your application starts up, and sharing this instance throughout your application. You should always set the default <code>BUCKET_NAME<\/code>, <code>SCOPE_NAME<\/code>, <code>COL_NAME<\/code> environment variables, and use the <code>InitCluster<\/code> function to get the instances. You should share and use these instances throughout your application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Couchbase connection is established in the <code>connectCluster<\/code> method defined in <code>db.h<\/code> and implemented in <code>db.cpp<\/code>. There, we call the <a href=\"https:\/\/docs.couchbase.com\/sdk-api\/couchbase-cxx-client-1.0.5\/classcouchbase_1_1cluster.html#a57285fbf793227e26d88de3808f9a707\">&#8220;connect&#8221;<\/a> method defined in the SDK to create the Database connection. If the connection is already established, we do not do anything. Following connection to the cluster, get the reference to the bucket, scope and collection and return all the objects as a tuple.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/ db.cpp\n...\nauto [connect_err, cluster] = couchbase::cluster::connect(DB_CONN_STRING, options).get();\n...\nauto bucket = cluster.bucket(BUCKET_NAME);\n...\nauto scope = bucket.scope(SCOPE_NAME);\nauto col = scope.collection(COL_NAME);\nreturn {cluster, bucket, scope, col};\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-operations\" class=\"wp-block-heading\">Operations<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Operations for interacting with the database are defined and implemented in <code>operations.h<\/code> and <code>operations.cpp<\/code>.<\/p>\n\n\n\n<h4 id=\"h-insert-document\" class=\"wp-block-heading\">Insert Document<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Insert function is the equivalent of the POST request and can be used to insert new documents to the collection. We can pass the document to be inserted as a JSON string or as a JSON file path, the function takes in file_flag which is used to differentiate between the two.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The value gets converted to the type <code>tao::json::value<\/code> and inserts it to the collection if <code>file_flag=false<\/code><\/li>\n\n\n<li>If <code>file_flag=true<\/code>, it reads the content from the provided file and then converts it to <code>tao::json::value<\/code>.<\/li>\n\n\n<li>Performs an upsert operation on the collection using the <code>doc_id<\/code> and the converted document content.<\/li>\n\n\n<li>If successful, <code>return 1<\/code>. If an error occurs, prints an error message and <code>return 0<\/code>.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/ operations.cpp\nauto [in_error, in_res] = col.insert(doc_id, v).get();\n\n\/\/main.cpp\nauto insert_res = Insert(col, &quot;quickstart_test&quot;, &quot;{ &quot;test&quot;: &quot;hello&quot;}&quot;, false);\nauto insert_res2 = Insert(col, &quot;quickstart_test2&quot;, &quot;doc.json&quot;, true);\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-upsert-document\" class=\"wp-block-heading\">Upsert Document<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Upsert function is the equivalent of the PUT request. It can be used to update any existing document or to insert a new document to the collection if the <code>doc_id<\/code> doesn&#8217;t exist already. Similar to Insert, We can pass the document to be inserted as a JSON string or as a JSON file path, the function takes in file_flag which is used to differentiate between the two.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The value gets converted to the type <code>tao::json::value<\/code> and inserts it to the collection if <code>file_flag=false<\/code><\/li>\n\n\n<li>If <code>file_flag=true<\/code>, it reads the content from the provided file and then converts it to <code>tao::json::value<\/code>.<\/li>\n\n\n<li>Performs an insert operation on the collection using the <code>doc_id<\/code> and the converted document content.<\/li>\n\n\n<li>If successful, <code>return 1<\/code>. If an error occurs, prints an error message and <code>return 0<\/code>.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/ operations.cpp\nauto [up_error, up_res] = col.upsert(doc_id, v).get();\n\n\/\/main.cpp\nauto upsert_res = Upsert(col, &quot;quickstart_test&quot;, &quot;{ &quot;test&quot;: &quot;hello&quot;}&quot;, false);\nauto upsert_res2 = Upsert(col, &quot;quickstart_test2&quot;, &quot;doc.json&quot;, true);\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-read\" class=\"wp-block-heading\">Read<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Read function is equivalent to GET requests and can be used to fetch documents using the <code>doc_id<\/code>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First checks if the document exists using <code>col.exists(doc_id)<\/code>.<\/li>\n\n\n<li>If the document exists, it retrieves the document&#8217;s content using <code>col.get(doc_id)<\/code> and returns it after converting it to <code>tao::json::value<\/code> for easier usage on return.<\/li>\n\n\n<li>If an error occurs (e.g., document not found), it prints an error message and returns an empty tao::json::value object.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/operations.cpp\nauto [ex_err, ex_res] = col.exists(doc_id).get();\n...\nauto [get_err, get_res] = col.get(doc_id).get();\n...\nauto doc = get_res.content_as&lt;tao::json::value&gt;();\nreturn doc;\n\n\/\/main.cpp\nauto v = Read(col, &quot;airline_10123&quot;);\nstd::cout &lt;&lt; tao::json::to_string(v) &lt;&lt; std::endl;\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-delete\" class=\"wp-block-heading\">Delete<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Delete function attempts to remove a document with the given <code>doc_id<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Attempts to remove the document with a given <code>doc_id<\/code> from the collection.<\/li>\n\n\n<li>If the deletion is successful, <code>return 1<\/code> and if an error occurs, it prints an error message and <code>return 0<\/code>.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/operations.cpp\nauto [delete_err, delete_res] = col.remove(doc_id).get();\n\n\/\/main.cpp\nauto res = Delete(col, doc_id);\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-query\" class=\"wp-block-heading\">Query<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">We can use the <code>Query<\/code> function to execute any N1QL (SQL++) query on a scope.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Executes the N1QL query using the provided <code>scope.query(query, opts)<\/code>.<\/li>\n\n\n<li>Returns the result of the query if successful. The result is added to a <code>std::vector&lt;std::string&gt;<\/code> object that contains the <code>id, country, avg_rating, title<\/code>.<\/li>\n\n\n<li>We can pass <code>opts<\/code> parameter, which can be used to insert positional parameters in the query.<\/li>\n\n\n<li>If there is an error, it prints an error message and returns an empty result object.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/operations.cpp\nstd::string query{ R&quot;(        \n    SELECT META(h).id, h AS doc,\n            AVG(r.ratings.Overall) AS avg_rating\n    FROM hotel h\n    UNNEST h.reviews r\n    WHERE h.country IN $1 AND h.description LIKE &quot;%cheap%&quot;\n    GROUP BY META(h).id, h\n    ORDER BY avg_rating DESC\n    LIMIT 5;\n)&quot; };\nauto [q_err, q_res] = scope.query(query, couchbase::query_options{}.positional_parameters(std::vector&lt;std::string&gt;{&quot;United States&quot;, &quot;United Kingdom&quot;})).get();\n\n\/\/main.cpp\nfor (auto&amp; row : query_res) {\n  std::cout &lt;&lt; row &lt;&lt; std::endl;\n}\n\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-create-search-index\" class=\"wp-block-heading\">Create Search Index<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Search indexes in Couchbase are used for full-text search and efficient querying of documents based on specific fields or attributes. The <code>CreateSearchIndex<\/code> function helps in creating a new Search index which can then be used.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Reads the index configuration from the <code>index_file<\/code>.<\/li>\n\n\n<li>Checks if an index with the same name already exists using the <code>searchIndexExists<\/code> function.<\/li>\n\n\n<li>If the index with same name exists, it returns the index name.<\/li>\n\n\n<li>If the index does not exist, it constructs a new search index object and upserts it into the Couchbase scope.<\/li>\n\n\n<li>Returns the name of the newly created index or an empty string if there was an error.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/ operations.cpp\nauto err = scope_index_manager.upsert_index(i).get();\n\n\/\/main.cpp\nstd::string index_name = CreateSearchIndex(scope, &quot;hotel_search_index.json&quot;);\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-search-by-name\" class=\"wp-block-heading\">Search By Name<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>SearchByName<\/code> function aims to demonstrate the usage of a search index to search for documents in a scope.\nParams:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>scope<\/code>: The Couchbase scope to search in.<\/li>\n\n\n<li><code>index<\/code>: The search index name to use for the query.<\/li>\n\n\n<li><code>name<\/code>: The name to search for in the documents.<\/li>\n\n\n<li><code>field<\/code>: The field where the name should be searched.<\/li>\n\n\n<li><code>limit<\/code>: The maximum number of results to return.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/operations.cpp\nauto [s_err, s_res] = scope.search(index, searchQ, opts).get();\n...\nstd::vector&lt;std::string&gt; rows_res{};\n\/\/ Reference is important since the copy constructor is deleted\nfor(auto &amp;row:s_res.rows()){\n    rows_res.push_back(row.id());\n}\nreturn rows_res;\n\n\/\/main.cpp\nauto search_res = SearchByName(scope, index_name, &quot;swanky&quot;, &quot;name&quot;, 50);\nstd::cout &lt;&lt; &quot;Search result contains:t&quot; &lt;&lt; search_res.size() &lt;&lt; std::endl;\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-filter\" class=\"wp-block-heading\">Filter<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>Filter<\/code> function aims to demo the construction and execution of a <code>conjunction_query<\/code> which can be described as an <code>AND<\/code> operation on two or more types of filters. This particular implementation performs a conjunction on <code>couchbase::match_query(\"United States\").field(\"country\")<\/code> and <code>couchbase::term_query(\"San Diego\").field(\"city\")<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c++\"><code>\/\/operations.cpp\nauto query = couchbase::conjunction_query{\n        couchbase::match_query(&quot;United States&quot;).field(&quot;country&quot;),\n        couchbase::term_query(&quot;San Diego&quot;).field(&quot;city&quot;)\n    };\n...\nauto [err,res] = scope.search(index_name, couchbase::search_request(query), opts).get();\n\nfor(auto &amp;row:res.rows()){\n  auto fields = row.fields_as&lt;couchbase::codec::tao_json_serializer&gt;();\n  rows_res.push_back(fields[&quot;name&quot;].as&lt;std::string&gt;());\n}\nreturn rows_res;\n\n\/\/main.cpp\nauto filter_res = Filter(scope, index_name, 50, 1);\nstd::cout &lt;&lt; &quot;Filter result contains:t&quot; &lt;&lt; filter_res.size() &lt;&lt; std::endl;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents, how to write simple parameterized SQL++ queries, and how to create and perform simple and complex search operations using Search indexes. Prerequisites To run this prebuilt project, you will need: Application Setup We [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[576],"tutorial-tags":[577,578],"tutorial-technologies":[573,572,548,549],"tutorial-types":[550],"class_list":["post-10247","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-c","tutorial-tags-c","tutorial-tags-c-sdk","tutorial-technologies-fts","tutorial-technologies-index","tutorial-technologies-kv","tutorial-technologies-query","tutorial-types-quickstart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Quickstart in Couchbase with C++ - Couchbase<\/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\/de\/developers\/tutorials\/cxx-quickstart\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quickstart in Couchbase with C++\" \/>\n<meta property=\"og:description\" content=\"Introduction In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents, how to write simple parameterized SQL++ queries, and how to create and perform simple and complex search operations using Search indexes. Prerequisites To run this prebuilt project, you will need: Application Setup We [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"11\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/cxx-quickstart\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/cxx-quickstart\\\/\",\"name\":\"Quickstart in Couchbase with C++ - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#website\"},\"datePublished\":\"2026-02-13T07:44:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/cxx-quickstart\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/cxx-quickstart\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/cxx-quickstart\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quickstart in Couchbase with C++\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Quickstart in Couchbase with C++ - Couchbase","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\/de\/developers\/tutorials\/cxx-quickstart\/","og_locale":"de_DE","og_type":"article","og_title":"Quickstart in Couchbase with C++","og_description":"Introduction In this tutorial, you will learn how to connect to a Couchbase Capella cluster to create, read, update, and delete documents, how to write simple parameterized SQL++ queries, and how to create and perform simple and complex search operations using Search indexes. Prerequisites To run this prebuilt project, you will need: Application Setup We [&hellip;]","og_url":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"11\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/","url":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/","name":"Quickstart in Couchbase with C++ - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/de\/#website"},"datePublished":"2026-02-13T07:44:27+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/cxx-quickstart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Quickstart in Couchbase with C++"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/de\/#website","url":"https:\/\/www.couchbase.com\/de\/","name":"Couchbase","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/de\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/de\/#organization","name":"Couchbase","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.couchbase.com\/de\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase ist ein in San Jose, Kalifornien, ans\u00e4ssiges Unternehmen f\u00fcr Datenbanksoftware, das eine operative Datenplattform f\u00fcr KI bereitstellt, die von Hunderten von globalen Unternehmen eingesetzt wird.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials\/10247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials\/10247\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/media?parent=10247"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-languages?post=10247"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-tags?post=10247"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-technologies?post=10247"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-types?post=10247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}