{"id":4721,"date":"2018-03-06T04:43:47","date_gmt":"2018-03-06T12:43:47","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=4721"},"modified":"2023-10-20T10:19:51","modified_gmt":"2023-10-20T17:19:51","slug":"5-common-forums-questions","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/","title":{"rendered":"The 5 Most Common Forum&#8217;s Questions"},"content":{"rendered":"<h3><b>How to do \u201csomething\u201d in N1QL?<\/b><\/h3>\n<p><span style=\"font-weight: 400\">First of all, <\/span><span style=\"font-weight: 400\">if you are not familiar with N1QL I highly recommend you to spend a few minutes in our free N1QL training <\/span><a href=\"https:\/\/training.couchbase.com\/online\"><span style=\"font-weight: 400\">here<\/span><\/a><span style=\"font-weight: 400\">, \u00a0or just play with it <\/span><a href=\"https:\/\/query-tutorial.couchbase.com\/tutorial\/#1\"><span style=\"font-weight: 400\">here<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Second, as it is a broad question, let\u2019s go through some common scenarios:<\/span><\/p>\n<p>&nbsp;<\/p>\n<h4><b>Select the id of a document and all its attributes:<\/b><\/h4>\n<pre class=\"lang:default decode:true\">Select meta(t).id as id, t.* from `myBucket` t where type = 'someType'<\/pre>\n<h4><\/h4>\n<h4><b>How to write a JOIN:<\/b><\/h4>\n<p><span style=\"font-weight: 400\">Let\u2019s query which companies fly from San Francisco airport (SFO) to anywhere in the world using the travel sample:<\/span><\/p>\n<pre class=\"lang:default decode:true\">SELECT \u00a0airline.name, airline.callsign, route.destinationairport, route.stops, route.airline\r\nFROM `travel-sample` route JOIN `travel-sample` airline ON KEYS route.airlineid\r\nWHERE route.type = \"route\"\r\nAND airline.type = \"airline\"\r\nAND route.sourceairport = \"SFO\"\r\nAND route.stops = 0\r\nORDER BY airline.name<\/pre>\n<p><span style=\"font-weight: 400\">The <\/span><b><i>JOIN<\/i><\/b><span style=\"font-weight: 400\"> clause looks like a standard SQL JOIN, the only difference here is the <\/span><b><i>ON KEYS <\/i><\/b><span style=\"font-weight: 400\">keyword, to read more about it <\/span><a href=\"https:\/\/dzone.com\/articles\/visually-explaining-n1ql-joins\"><span style=\"font-weight: 400\">check this article explaining visually N1QL JOINs<\/span><\/a><span style=\"font-weight: 400\">. Couchbase 5.5 will also add support to <a href=\"https:\/\/www.couchbase.com\/blog\/ansi-join-support-n1ql\/\">ANSI JOINs<\/a><\/span><\/p>\n<h4><b>How to select items of an array:<\/b><\/h4>\n<p><span style=\"font-weight: 400\">Given documents like:<\/span><\/p>\n<pre class=\"lang:js decode:true\">{\r\n  type: \u201cperson\u201d,\r\n  name: \u201cJohn\u201d,\r\n  children: [\r\n    {\r\n      \u201cname\u201d: \u201cPedro\u201d,\r\n      \u201cage\u201d: 8\r\n    },\r\n    {\r\n       \u201cname\u201d: \u201cGeorge\u201d,\r\n       \u201cage\u201d: 11\r\n    }\r\n  ]\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">If we want to select all children who are more than 10 years old, we could use the <strong>UNNEST<\/strong> keyword: <\/span><\/p>\n<pre class=\"lang:default decode:true \">SELECT c.* FROM tutorial t UNNEST t.children c WHERE c.age &gt; 10<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><b>Why my query is slow?<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Probably your query is not hitting any indexes. You can check that by running your query with the <\/span><b><i>explain<\/i><\/b><span style=\"font-weight: 400\"> keyword, as follows:<\/span><\/p>\n<p><span style=\"font-weight: 400\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4724\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/explain-query-correct-1024x778.png\" alt=\"\" width=\"710\" height=\"540\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/explain-query-correct-1024x778.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/explain-query-correct-300x228.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/explain-query-correct-768x584.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/explain-query-correct-1536x1167.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/explain-query-correct-20x15.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/explain-query-correct-1320x1003.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/explain-query-correct.png 1666w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/span><\/p>\n<p><span style=\"font-weight: 400\">As you can see in the image above, the query is hitting the <\/span><b><i>PrimaryScan<\/i><\/b><span style=\"font-weight: 400\"> which means that it is using the primary index. Creating a secondary index for it will potentially solve your problem:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4725\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM-1024x369.png\" alt=\"\" width=\"700\" height=\"252\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM-1024x369.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM-300x108.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM-768x277.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM-1536x553.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM-20x7.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM-1320x476.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.03-PM.png 1932w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Executing the same query again will output something like:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4726\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM-1024x560.png\" alt=\"\" width=\"723\" height=\"395\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM-1024x560.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM-300x164.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM-768x420.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM-1536x840.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM-1320x721.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/Screen-Shot-2018-03-06-at-12.57.33-PM.png 1954w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/p>\n<p><span style=\"font-weight: 400\">If your query is already hitting an index but still has a poor performance, you might want to add a more optimized index (<\/span><a href=\"https:\/\/www.couchbase.com\/forums\/t\/order-by-performance-really-slow\/13173\/20\/\"><span style=\"font-weight: 400\">like in this example<\/span><\/a><span style=\"font-weight: 400\">). If you are not familiar with <\/span><span style=\"font-weight: 400\">how to create an index<\/span><span style=\"font-weight: 400\">, <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\"><span style=\"font-weight: 400\">check out this blog post<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3><b>How to paginate results in N1QL?<\/b><\/h3>\n<p><span style=\"font-weight: 400\">You can use <\/span><b><i>LIMIT<\/i><\/b><span style=\"font-weight: 400\"> and <\/span><b><i>OFFSET<\/i><\/b><span style=\"font-weight: 400\">:<\/span><\/p>\n<pre class=\"lang:default decode:true \">select * from `travel-sample` where country = 'United States' OFFSET 10 LIMIT 10<\/pre>\n<p><span style=\"font-weight: 400\">Check out <\/span><a href=\"https:\/\/dzone.com\/articles\/database-pagination-using-offset-and-keyset-in-n1q\"><span style=\"font-weight: 400\">this tutorial<\/span><\/a><span style=\"font-weight: 400\"> to read more about it.\u00a0<\/span><span style=\"font-weight: 400\">Additionally, if you are using Spring Data you can add a <\/span><b><i>Pageable<\/i><\/b><span style=\"font-weight: 400\"> object to the end of your method definition:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4727\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/repository-1024x203.png\" alt=\"\" width=\"763\" height=\"151\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/repository-1024x203.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/repository-300x60.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/repository-768x152.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/repository-20x4.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/repository.png 1270w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n<p><span style=\"font-weight: 400\">And then, in your Service you can use the <\/span><b><i>PageRequest<\/i><\/b><span style=\"font-weight: 400\"> object:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4728\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/service-1024x263.png\" alt=\"\" width=\"760\" height=\"195\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/service-1024x263.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/service-300x77.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/service-768x197.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/service-20x5.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/service-1320x339.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/service.png 1378w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><b>My query has missing results\/wrong results<\/b><\/h3>\n<p><span style=\"font-weight: 400\">By default, Couchbase supports <\/span><i><span style=\"font-weight: 400\">read-after-writes<\/span><\/i><span style=\"font-weight: 400\"> whenever you get a document by its key, but your indexes and views are updated asynchronously via Data Change Protocol (DCP). So, if you are executing a query right after a write, it might be executed before the views\/indexes had a chance to be updated.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase is all about speed, and no one has time to wait until all indexes and views are updated to send the response back to the client that a write has been executed successfully.<\/span><\/p>\n<p><span style=\"font-weight: 400\">But there are few scenarios where strong consistency between writes and your queries are actually needed, for those cases you can specify via SDK that you actually want to wait until the index\/view you are using is updated:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-4729\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/consistency-1024x107.png\" alt=\"\" width=\"900\" height=\"94\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/consistency-1024x107.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/consistency-300x31.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/consistency-768x80.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/consistency-20x2.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/consistency-1320x138.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/consistency.png 1432w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><span style=\"font-weight: 400\">To read more about scan consistency, please refer to the <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/6.0\/learn\/services-and-indexes\/indexes\/index-replication.html\"><span style=\"font-weight: 400\">official documentation<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In my personal experience, I only scenario where I do need consistency between writes and queries is during the <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/integration-tests-couchbase-application\/\"><b><i>integration tests<\/i><\/b><\/a><span style=\"font-weight: 400\"> phase, which is when you actually insert data and query it right after. <\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><b>How to Creating\/use Array Indexes.<\/b><\/h3>\n<p><span style=\"font-weight: 400\">This is an interesting topic, as <\/span><b><i>array indexing<\/i><\/b><span style=\"font-weight: 400\"> might speed up significantly your performance. So, let\u2019s say we have the following document structure:<\/span><\/p>\n<pre class=\"lang:default decode:true\">{\r\n\u00a0\u00a0\u00a0\"address\": \"Capstone Road, ME7 3JE\",\r\n\u00a0\u00a0\u00a0\"alias\": null,\r\n\u00a0\u00a0\u00a0\"city\": \"Medway\",\r\n\u00a0\u00a0\u00a0\"country\": \"United Kingdom\",\r\n\u00a0\u00a0\u00a0\"description\": \"40 bed summer hostel about 3 miles from Gillingham, housed in a districtive converted Oast House in a semi-rural setting.\",\r\n\u00a0\u00a0\u00a0\"directions\": null,\r\n\u00a0\u00a0\u00a0\"email\": null,\r\n\u00a0\u00a0\u00a0\"fax\": null,\r\n\u00a0\u00a0\u00a0 \u2026\r\n\u00a0\u00a0\u00a0\"id\": 10025,\r\n\u00a0\u00a0\u00a0\"name\": \"Medway Youth Hostel\",\r\n\u00a0\u00a0\u00a0\"pets_ok\": true,\r\n\u00a0\u00a0\u00a0\"phone\": \"+44 870 770 5964\",\r\n\u00a0\u00a0\u00a0\"price\": null,\r\n\u00a0\u00a0\u00a0\"reviews\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"author\": \"Ozella Sipes\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"content\": \"Some review here\u2026\u201d,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"date\": \"2013-06-22 18:33:50 +0300\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"ratings\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Cleanliness\": 5,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Location\": 4,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Overall\": 4,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Rooms\": 3,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Service\": 5,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Value\": 4\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n     }\r\n   ]\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">Now, if we need to query hotel reviews, we could do something like:<\/span><\/p>\n<pre class=\"lang:default decode:true\">SELECT c.* FROM `travel-sample` t UNNEST t.reviews c where t.type == \"hotel\" limit 100<\/pre>\n<p><span style=\"font-weight: 400\">So, the simplest index for the <\/span><b><i>reviews<\/i><\/b><span style=\"font-weight: 400\"> array <\/span><span style=\"font-weight: 400\">will<\/span><span style=\"font-weight: 400\"> look like the following:<\/span><\/p>\n<pre class=\"lang:default decode:true \">CREATE INDEX idx ON `travel-sample` (reviews) WHERE type = \"hotel\";<\/pre>\n<p><span style=\"font-weight: 400\">And then, when we execute the query, voil\u00e0:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4730\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/array_index-1024x564.png\" alt=\"\" width=\"778\" height=\"429\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/array_index-1024x564.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/array_index-300x165.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/array_index-768x423.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/array_index-1536x846.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/array_index-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/array_index-1320x727.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/03\/array_index.png 1982w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/p>\n<p><span style=\"font-weight: 400\">It is using the recently created index.<\/span><\/p>\n<p><span style=\"font-weight: 400\">For more examples, check the <\/span><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/indexing-arrays.html\"><span style=\"font-weight: 400\">official documentation<\/span><\/a><span style=\"font-weight: 400\"> or read <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/making-the-most-of-your-arrays-with-array-indexing\/\"><span style=\"font-weight: 400\">this excellent article<\/span><\/a><span style=\"font-weight: 400\"> about how to optimize array indexes.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to do \u201csomething\u201d in N1QL? First of all, if you are not familiar with N1QL I highly recommend you to spend a few minutes in our free N1QL training here, \u00a0or just play with it here. Second, as it [&hellip;]<\/p>\n","protected":false},"author":8754,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[9059],"class_list":["post-4721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The 5 Most Common Forum&#039;s Questions - 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\/5-common-forums-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The 5 Most Common Forum&#039;s Questions\" \/>\n<meta property=\"og:description\" content=\"How to do \u201csomething\u201d in N1QL? First of all, if you are not familiar with N1QL I highly recommend you to spend a few minutes in our free N1QL training here, \u00a0or just play with it here. Second, as it [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-06T12:43:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-20T17:19:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/explain-query-correct-1024x778.png\" \/>\n<meta name=\"author\" content=\"Denis Rosa, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@deniswsrosa\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Denis Rosa, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/\"},\"author\":{\"name\":\"Denis Rosa, Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/fe3c5273e805e72a5294611a48f62257\"},\"headline\":\"The 5 Most Common Forum&#8217;s Questions\",\"datePublished\":\"2018-03-06T12:43:47+00:00\",\"dateModified\":\"2023-10-20T17:19:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/\"},\"wordCount\":602,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/\",\"name\":\"The 5 Most Common Forum's Questions - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2018-03-06T12:43:47+00:00\",\"dateModified\":\"2023-10-20T17:19:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#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\/5-common-forums-questions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The 5 Most Common Forum&#8217;s Questions\"}]},{\"@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\/fe3c5273e805e72a5294611a48f62257\",\"name\":\"Denis Rosa, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/be0716f6199cfb09417c92cf7a8fa8d6\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f8d1f5c13115122cab89d0f229b904480bfe20d3dfbb093fe9734cda5235d419?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f8d1f5c13115122cab89d0f229b904480bfe20d3dfbb093fe9734cda5235d419?s=96&d=mm&r=g\",\"caption\":\"Denis Rosa, Developer Advocate, Couchbase\"},\"description\":\"Denis Rosa is a Developer Advocate for Couchbase and lives in Munich - Germany. He has a solid experience as a software engineer and speaks fluently Java, Python, Scala and Javascript. Denis likes to write about search, Big Data, AI, Microservices and everything else that would help developers to make a beautiful, faster, stable and scalable app.\",\"sameAs\":[\"https:\/\/x.com\/deniswsrosa\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/denis-rosa\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"The 5 Most Common Forum's Questions - 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\/5-common-forums-questions\/","og_locale":"en_US","og_type":"article","og_title":"The 5 Most Common Forum's Questions","og_description":"How to do \u201csomething\u201d in N1QL? First of all, if you are not familiar with N1QL I highly recommend you to spend a few minutes in our free N1QL training here, \u00a0or just play with it here. Second, as it [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/","og_site_name":"The Couchbase Blog","article_published_time":"2018-03-06T12:43:47+00:00","article_modified_time":"2023-10-20T17:19:51+00:00","og_image":[{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/03\/explain-query-correct-1024x778.png","type":"","width":"","height":""}],"author":"Denis Rosa, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@deniswsrosa","twitter_misc":{"Written by":"Denis Rosa, Developer Advocate, Couchbase","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/"},"author":{"name":"Denis Rosa, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/fe3c5273e805e72a5294611a48f62257"},"headline":"The 5 Most Common Forum&#8217;s Questions","datePublished":"2018-03-06T12:43:47+00:00","dateModified":"2023-10-20T17:19:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/"},"wordCount":602,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/","url":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/","name":"The 5 Most Common Forum's Questions - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2018-03-06T12:43:47+00:00","dateModified":"2023-10-20T17:19:51+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/5-common-forums-questions\/#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\/5-common-forums-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"The 5 Most Common Forum&#8217;s Questions"}]},{"@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\/fe3c5273e805e72a5294611a48f62257","name":"Denis Rosa, Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/be0716f6199cfb09417c92cf7a8fa8d6","url":"https:\/\/secure.gravatar.com\/avatar\/f8d1f5c13115122cab89d0f229b904480bfe20d3dfbb093fe9734cda5235d419?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8d1f5c13115122cab89d0f229b904480bfe20d3dfbb093fe9734cda5235d419?s=96&d=mm&r=g","caption":"Denis Rosa, Developer Advocate, Couchbase"},"description":"Denis Rosa is a Developer Advocate for Couchbase and lives in Munich - Germany. He has a solid experience as a software engineer and speaks fluently Java, Python, Scala and Javascript. Denis likes to write about search, Big Data, AI, Microservices and everything else that would help developers to make a beautiful, faster, stable and scalable app.","sameAs":["https:\/\/x.com\/deniswsrosa"],"url":"https:\/\/www.couchbase.com\/blog\/author\/denis-rosa\/"}]}},"authors":[{"term_id":9059,"user_id":8754,"is_guest":0,"slug":"denis-rosa","display_name":"Denis Rosa, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/f8d1f5c13115122cab89d0f229b904480bfe20d3dfbb093fe9734cda5235d419?s=96&d=mm&r=g","author_category":"","last_name":"Rosa, Developer Advocate, Couchbase","first_name":"Denis","job_title":"","user_url":"","description":"Denis Rosa is a Developer Advocate for Couchbase and lives in Munich - Germany. He has a solid experience as a software engineer and speaks fluently Java, Python, Scala and Javascript. Denis likes to write about search, Big Data, AI, Microservices and everything else that would help developers to make a beautiful, faster, stable and scalable app."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/4721","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\/8754"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=4721"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/4721\/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=4721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=4721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=4721"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=4721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}