{"id":2412,"date":"2016-10-17T17:37:53","date_gmt":"2016-10-17T17:37:52","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2412"},"modified":"2025-10-09T07:21:32","modified_gmt":"2025-10-09T14:21:32","slug":"n1ql-functionality-enhancements-in-couchbase-server-4-5-1","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/","title":{"rendered":"N1QL enhancements in 4.5.1 &#8211; Part1"},"content":{"rendered":"<p>Couchbase is all about enabling more and more enterprise applications to leverage and adopt NoSQL\/JSON data model. N1QL simplifies this transition from traditional Relational databases, and is built with tons of features to achieve best of both worlds. Continuing the train of Couchbase Server 4.5, the 4.5.1 release brings multiple functionality, usability and performance improvements in N1QL. These enhancements address many of our customer critical issues, and in general showcase the strength &amp; sophistication of N1QL.<\/p>\n<p>While some of the new improvements enhance existing functionality, others such as SUFFIXES() function enrich N1QL querying with magnitude performance improvement to LIKE queries. Further improvements enhance dynamic creation &amp; manipulation of JSON objects, precision of numbers, UPDATE syntax for nested arrays etc.,<\/p>\n<p>I am sure, this will need a series, but in this\u00a0blog I will highlight LIKE-query and UPDATE enhancements. See Couchbase Server 4.5.1 <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/4.5\/introduction\/whats-new.html\">what\u2019s new<\/a>\u00a0and <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/4.5\/release-notes\/relnotes.html\">release notes<\/a> for full list of N1QL enhancements.\u00a0<span style=\"color: #333333;line-height: 20.799999237060547px;text-align: left\">Kudos to N1QL team !!<\/span><\/p>\n<h2>Efficient pattern matching LIKE queries with SUFFIXES()<\/h2>\n<p>Pattern matching is a widely used functionality in SQL queries, and is typically achieved using the LIKE operator. Especially, efficient wildcard matching is very important. LIKE \u2018foo%\u2019 can be implemented efficiently with a standard index, but not LIKE \u2018%foo%\u2019. Such pattern matching with leading wildcard is vital, for every application that has a search box to match partial words or to smart-suggest matching text. For example,<\/p>\n<ul>\n<li>A travel booking site, that wants to pop-up matching airports as the user starts to enter few letters of the airport name.<\/li>\n<li>A user finding all e-mails with a specific word or partial word in the subject.<\/li>\n<li>Finding all topics of a forum or blog posts with specific keywords in the title.<\/li>\n<\/ul>\n<p>In Couchbase Server 4.5.1, N1QL addresses this problem by adding a new string function SUFFIXES(), and combining that with the Array Indexing functionality introduced in Couchbase Server 4.5. Together, it brings magnitude difference to performance of LIKE queries with leading wildcards such as LIKE &#8220;%foo%&#8221;. Core functionality of SUFFIXES() is very simple, basically it produces an array of all possible suffix substrings of a given string. For example,<\/p>\n<pre><code class=\"language-javascript\">SUFFIXES(\"N1QL\") = [ \"N1QL\", \"1QL\", \"QL\", \"L\" ]<\/code><\/pre>\n<p>Following picture depicts a\u00a0unique technique to combine <code>SUFFIXES()<\/code> function with Array Indexing to magically boost <code>LIKE<\/code> query performance.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2664\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2016\/10\/suffixes1.png\" alt=\"\" width=\"1900\" height=\"1069\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1.png 1900w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1-300x169.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1-1024x576.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1-768x432.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1-1536x864.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1-1320x743.png 1320w\" sizes=\"auto, (max-width: 1900px) 100vw, 1900px\" \/><\/p>\n<ol>\n<li>Step1 (in blue) shows the array of suffix substrings generated by <code>SUFFIXES()<\/code> for <code>doc1.title<\/code><\/li>\n<li>Step2 (in yellow) shows the Array Index created with the suffix substrings generated in step1. Note that the index-entry for <code>\"wood\"<\/code> points to <code>doc1<\/code> and <code>doc4<\/code>, as that is one of the suffix substrings of titles of both the documents. Similarly, <code>\"ood\"<\/code> points to <code>doc1<\/code>, <code>doc4<\/code>, and <code>doc8<\/code>.<\/li>\n<li>Step3 (in green) runs a query equivalent to <code>SELECT title FROM bucket WHERE title LIKE \"%wood%\"<\/code>. The LIKE predicate is transformed to use the Array Index using the ANY construct. See documentation for more details on using array indexing.\n<ul>\n<li>Note that, the leading wildcard is removed in the new <code>LIKE \"wood%\"<\/code> predicate.<\/li>\n<li>This is accurate transformation, because the array index lookup for <code>\"wood\"<\/code> points to all documents whose title has\u00a0trailing substring <code>\"wood\"<\/code><\/li>\n<\/ul>\n<\/li>\n<li>In Step4, N1QL looks-up in the Array Index to find all documents matching <code>\"wood%\"<\/code>. That returns <code>{doc1, doc3, doc4}<\/code>, because\n<ul>\n<li>the index lookup produces a span, which gets documents from <code>\"wood\"<\/code> to <code>\"wooe\"<\/code><\/li>\n<li><code>doc1<\/code> and <code>doc4<\/code> are matched because of index entry &#8220;wood&#8221; that is generated by the SUFFIXES() when creating the array index.<\/li>\n<li><code>doc3<\/code> is matched because of its corresponding index-entry for <code>\"woodland\"<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Finally, in step5, N1QL returns the query results.<\/li>\n<\/ol>\n<p>Let&#8217;s see a working example with the <code>travel-sample<\/code> documents, which showed a 12x boost in performance for the query.<\/p>\n<ol>\n<li>Assume a document with a string field whose value is few words of text or a phrase. For example, title of a landmark, address of a place, name of restaurant, \u00a0full name of a person\/place etc., For this explanation, we consider <code>title<\/code> of <code>landmark<\/code> documents in <code> travel-sample<\/code>.<\/li>\n<li>Create secondary index on <code>title<\/code> field using <code>SUFFIXES()<\/code> as:\n<pre><code class=\"language-sql\">       CREATE INDEX idx_title_suffix \r\n       ON `travel-sample`(DISTINCT ARRAY s FOR s IN SUFFIXES(title) END)\r\n       WHERE type = \"landmark\";<\/code><\/pre>\n<p><code>SUFFIXES(title)<\/code> generates all possible suffix substrings of <code>title<\/code>, and the index will have entries for each of those substrings, all referencing to corresponding documents.<\/li>\n<li>Now consider following query, which finds all docs with substring <code>\"land\"<\/code> in <code>title<\/code>.\u00a0This query produces following plan, and runs in roughly 120ms in my laptop. You can clearly see, it fetches all <code>landmark<\/code> documents, and then applies the <code>LIKE \"%land%\"<\/code>predicate to find all matching documents.\n<pre><code class=\"language-sql\">EXPLAIN SELECT * FROM `travel-sample` USE INDEX(def_type) WHERE type = \"landmark\" AND title LIKE \"%land%\";\r\n[\r\n  {\r\n    \"plan\": {\r\n      \"#operator\": \"Sequence\",\r\n      \"~children\": [\r\n        {\r\n          \"#operator\": \"IndexScan\",\r\n          \"index\": \"def_type\",\r\n          \"index_id\": \"e23b6a21e21f6f2\",\r\n          \"keyspace\": \"travel-sample\",\r\n          \"namespace\": \"default\",\r\n          \"spans\": [\r\n            {\r\n              \"Range\": {\r\n                \"High\": [\r\n                  \"\"landmark\"\"\r\n                ],\r\n                \"Inclusion\": 3,\r\n                \"Low\": [\r\n                  \"\"landmark\"\"\r\n                ]\r\n              }\r\n            }\r\n          ],\r\n          \"using\": \"gsi\"\r\n        },\r\n        {\r\n          \"#operator\": \"Fetch\",\r\n          \"keyspace\": \"travel-sample\",\r\n          \"namespace\": \"default\"\r\n        },\r\n        {\r\n          \"#operator\": \"Parallel\",\r\n          \"~child\": {\r\n            \"#operator\": \"Sequence\",\r\n            \"~children\": [\r\n              {\r\n                \"#operator\": \"Filter\",\r\n                \"condition\": \"(((`travel-sample`.`type`) = \"landmark\") and ((`travel-sample`.`title`) like \"%land%\"))\"\r\n              }\r\n            ]\r\n        }<\/code><\/pre>\n<\/li>\n<li>In Couchbase 4.5.1, this query can be rewritten to leverage the array index <code>idx_title_suffix<\/code> created in (2) above.\n<pre><code class=\"language-sql\">EXPLAIN SELECT title FROM `travel-sample` USE INDEX(idx_title_suffix) WHERE type = \"landmark\" AND  \r\nANY s IN SUFFIXES(title) SATISFIES s LIKE \"land%\"  END;\r\n[\r\n  {\r\n    \"plan\": {\r\n      \"#operator\": \"Sequence\",\r\n      \"~children\": [\r\n        {\r\n          \"#operator\": \"DistinctScan\",\r\n          \"scan\": {\r\n            \"#operator\": \"IndexScan\",\r\n            \"index\": \"idx_title_suffix\",\r\n            \"index_id\": \"75b20d4b253214d1\",\r\n            \"keyspace\": \"travel-sample\",\r\n            \"namespace\": \"default\",\r\n            \"spans\": [\r\n              {\r\n                \"Range\": {\r\n                  \"High\": [\r\n                    \"\"lane\"\"\r\n                  ],\r\n                  \"Inclusion\": 1,\r\n                  \"Low\": [\r\n                    \"\"land\"\"\r\n                  ]\r\n                }\r\n              }\r\n            ],\r\n            \"using\": \"gsi\"\r\n          }\r\n        },\r\n        {\r\n          \"#operator\": \"Fetch\",\r\n          \"keyspace\": \"travel-sample\",\r\n          \"namespace\": \"default\"\r\n        },\r\n        {\r\n          \"#operator\": \"Parallel\",\r\n          \"~child\": {\r\n            \"#operator\": \"Sequence\",\r\n            \"~children\": [\r\n              {\r\n                \"#operator\": \"Filter\",\r\n                \"condition\": \"(((`travel-sample`.`type`) = \"landmark\") and any `s` in suffixes((`travel-sample`.`title`)) satisfies (`s` like \"land%\") end)\"\r\n              },\r\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>Note that:<\/p>\n<ul>\n<li>The new query in (4) uses <code>LIKE \u201cland%\u201d<\/code>, instead of <code>LIKE \u201c%land%\u201d<\/code>. The former predicate with no leading wildcard <code>'%'<\/code> produces much more efficient index lookup than the later one which can\u2019t pushdown the predicate to index.<\/li>\n<li>the array index <code>idx_title_suffix<\/code> is created with all possible suffix substrings of <code>title<\/code>, and hence lookup for any suffix substring of title can find successful match.<\/li>\n<li>in the above 4.5.1 query plan in (4), N1QL pushes down the LIKE predicate to the index lookup, and avoids additional pattern-matching string processing. This query ran in 18ms.<\/li>\n<li>Infact, with following covering Array Index, the query ran in 10ms, which is 12x faster.<\/li>\n<\/ul>\n<pre><code class=\"language-sql\">       CREATE INDEX idx_title_suffix_cover\r\n       ON `travel-sample`(DISTINCT ARRAY s FOR s IN SUFFIXES(title) END, title)\r\n       WHERE type = \"landmark\";<\/code><\/pre>\n<p>See this <a href=\"https:\/\/dzone.com\/articles\/a-couchbase-index-technique-for-like-predicates-wi\">blog<\/a> for details on a real-world application of this feature.<\/p>\n<h2>Enhancements to UPDATE to work with Nested Arrays<\/h2>\n<p>Enterprise applications often have complex data, and need to model JSON documents with multiple levels of nested objects and arrays. N1QL supports complex expressions and language constructs to navigate and query such documents with nested arrays. N1QL also supports <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/4.5\/n1ql\/n1ql-language-reference\/indexing-arrays.html\">Array Indexing<\/a>, with which secondary indexes can be created on array elements, and subsequently queried.<br \/>\nIn Couchbase Server 4.5.1, the <code>UPDATE<\/code> statement syntax is improved to navigate nested arrays in documents, and update specific fields in nested array elements. The <code>FOR<\/code>-clause of the <code>UPDATE<\/code> statement is enhanced to evaluate functions and expressions, and the new syntax supports multiple nested <code>FOR<\/code> expressions to access and update fields in nested arrays.<br \/>\nConsider following document with nested array like:<\/p>\n<pre><code class=\"language-javascript\">{ \r\n  items: [\r\n    {\r\n      subitems: [\r\n        {\r\n          name: \"N1QL\"\r\n        },\r\n        {\r\n          name: \"GSI\"\r\n        }\r\n      ] \r\n    }\r\n  ],\r\n  docType: \"couchbase\"   \r\n}<\/code><\/pre>\n<p>The new <code>UPDATE<\/code> syntax in 4.5.1 can be used in different ways to access &amp; update nested arrays:<\/p>\n<ul>\n<li>\n<pre><code class=\"language-sql\">UPDATE default SET s.newField = 'newValue' \r\nFOR s IN ARRAY_FLATTEN(items[*].subitems, 1) END; <\/code><\/pre>\n<\/li>\n<li>\n<pre><code class=\"language-sql\">UPDATE default \r\nSET s.newField = 'newValue' \r\nFOR s IN ARRAY_FLATTEN(ARRAY i.subitems FOR i IN items END, 1) END; <\/code><\/pre>\n<\/li>\n<li>\n<pre><code class=\"language-sql\">UPDATE default \r\nSET i.subitems = ( ARRAY OBJECT_ADD(s, 'newField', 'newValue') \r\n                   FOR s IN i.subitems END ) FOR i IN items END; <\/code><\/pre>\n<\/li>\n<\/ul>\n<p>Note that:<\/p>\n<ul>\n<li>The <code>SET<\/code>-clause evaluates functions such as <code>OBJECT_ADD()<\/code> and <code>ARRAY_FLATTEN()<\/code><\/li>\n<li><code>FOR<\/code> constructs can be used in nested fashion with expressions to process array elements at different nest-levels.<\/li>\n<\/ul>\n<p>For a working example, consider the sample bucket <code>travel-sample<\/code> \u00a0shipped with 4.5.1.<\/p>\n<ol>\n<li>First, let\u2019s add a nested array of special flights to the array schedule in <code>travel-sample<\/code> bucket, for some documents.\n<pre><code class=\"language-sql\">UPDATE `travel-sample` \r\nSET schedule[0] = {\"day\" : 7, \"special_flights\" : \r\n                    [ {\"flight\" : \"AI444\", \"utc\" : \"4:44:44\"}, \r\n                      {\"flight\" : \"AI333\", \"utc\" : \"3:33:33\"} \r\n                    ] } \r\nWHERE type = \"route\" AND destinationairport = \"CDG\" AND sourceairport = \"TLV\";<\/code><\/pre>\n<\/li>\n<li>following UPDATE statement \u00a0adds a 3rd field to each special flight:\n<pre><code class=\"language-sql\">UPDATE `travel-sample`\r\nSET i.special_flights = ( ARRAY OBJECT_ADD(s, 'newField', 'newValue' ) \r\n                          FOR s IN i.special_flights END ) \r\n                                       FOR i IN schedule END\r\nWHERE type = \"route\" AND destinationairport = \"CDG\" AND sourceairport = \"TLV\";\r\n\r\n\r\nSELECT schedule[0] from `travel-sample` \r\nWHERE type = \"route\" AND destinationairport = \"CDG\" AND sourceairport = \"TLV\" LIMIT 1;\r\n[\r\n  {\r\n    \"$1\": {\r\n      \"day\": 7,\r\n      \"special_flights\": [\r\n        {\r\n          \"flight\": \"AI444\",\r\n          \"newField\": \"newValue\",\r\n          \"utc\": \"4:44:44\"\r\n        },\r\n        {\r\n          \"flight\": \"AI333\",\r\n          \"newField\": \"newValue\",\r\n          \"utc\": \"3:33:33\"\r\n        }\r\n      ]\r\n    }\r\n  }\r\n]<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>There are many more important N1QL enhanements and Performance features in Couchbase Server 4.5.1 release. Will write about them in my <a href=\"https:\/\/www.couchbase.com\/blog\/more-n1ql-enhancements-in-4.5.1---part2\/\">next blog\/part2<\/a>.<\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/nosql-databases\/downloads\/\">Download 4.5.1<\/a>\u00a0and\u00a0give it a try.\u00a0Let me know any questions\/comments, or just how awesome it is ;-)<br \/>\nCheers!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Couchbase is all about enabling more and more enterprise applications to leverage and adopt NoSQL\/JSON data model. N1QL simplifies this transition from traditional Relational databases, and is built with tons of features to achieve best of both worlds. Continuing the [&hellip;]<\/p>\n","protected":false},"author":70,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1812],"tags":[1840],"ppma_author":[8935],"class_list":["post-2412","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-n1ql-query","tag-array-index"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.0 (Yoast SEO v26.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>N1QL enhancements in 4.5.1 - Part1 - 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\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"N1QL enhancements in 4.5.1 - Part1\" \/>\n<meta property=\"og:description\" content=\"Couchbase is all about enabling more and more enterprise applications to leverage and adopt NoSQL\/JSON data model. N1QL simplifies this transition from traditional Relational databases, and is built with tons of features to achieve best of both worlds. Continuing the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-17T17:37:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-09T14:21:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1900\" \/>\n\t<meta property=\"og:image:height\" content=\"1069\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prasad Varakur, Principal Product Manager, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasad Varakur, Principal Product Manager, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/\"},\"author\":{\"name\":\"Prasad Varakur, Principal Product Manager, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c649b2296584f6b734c5a21681137e46\"},\"headline\":\"N1QL enhancements in 4.5.1 &#8211; Part1\",\"datePublished\":\"2016-10-17T17:37:52+00:00\",\"dateModified\":\"2025-10-09T14:21:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/\"},\"wordCount\":1064,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"Array Index\"],\"articleSection\":[\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/\",\"name\":\"N1QL enhancements in 4.5.1 - Part1 - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2016-10-17T17:37:52+00:00\",\"dateModified\":\"2025-10-09T14:21:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#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\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"N1QL enhancements in 4.5.1 &#8211; Part1\"}]},{\"@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\/c649b2296584f6b734c5a21681137e46\",\"name\":\"Prasad Varakur, Principal Product Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5d664f4b9aadb80e438fd06cce0d151e\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3dd2299380c7af4e8a9732a0465d1c082c95eaff26cdf4abf54816d9b693043a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3dd2299380c7af4e8a9732a0465d1c082c95eaff26cdf4abf54816d9b693043a?s=96&d=mm&r=g\",\"caption\":\"Prasad Varakur, Principal Product Manager, Couchbase\"},\"description\":\"Prasad Varakur is a Principal Product Manager, Couchbase. Prasad is Product and Engineering leader in Databases(SQL, noSQL, Bigdata) &amp; Distributed systems.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/prasad-varakur\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"N1QL enhancements in 4.5.1 - Part1 - 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\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/","og_locale":"en_US","og_type":"article","og_title":"N1QL enhancements in 4.5.1 - Part1","og_description":"Couchbase is all about enabling more and more enterprise applications to leverage and adopt NoSQL\/JSON data model. N1QL simplifies this transition from traditional Relational databases, and is built with tons of features to achieve best of both worlds. Continuing the [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/","og_site_name":"The Couchbase Blog","article_published_time":"2016-10-17T17:37:52+00:00","article_modified_time":"2025-10-09T14:21:32+00:00","og_image":[{"width":1900,"height":1069,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2016\/10\/suffixes1.png","type":"image\/png"}],"author":"Prasad Varakur, Principal Product Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prasad Varakur, Principal Product Manager, Couchbase","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/"},"author":{"name":"Prasad Varakur, Principal Product Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c649b2296584f6b734c5a21681137e46"},"headline":"N1QL enhancements in 4.5.1 &#8211; Part1","datePublished":"2016-10-17T17:37:52+00:00","dateModified":"2025-10-09T14:21:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/"},"wordCount":1064,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["Array Index"],"articleSection":["SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/","url":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/","name":"N1QL enhancements in 4.5.1 - Part1 - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2016-10-17T17:37:52+00:00","dateModified":"2025-10-09T14:21:32+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#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\/n1ql-functionality-enhancements-in-couchbase-server-4-5-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"N1QL enhancements in 4.5.1 &#8211; Part1"}]},{"@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\/c649b2296584f6b734c5a21681137e46","name":"Prasad Varakur, Principal Product Manager, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5d664f4b9aadb80e438fd06cce0d151e","url":"https:\/\/secure.gravatar.com\/avatar\/3dd2299380c7af4e8a9732a0465d1c082c95eaff26cdf4abf54816d9b693043a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3dd2299380c7af4e8a9732a0465d1c082c95eaff26cdf4abf54816d9b693043a?s=96&d=mm&r=g","caption":"Prasad Varakur, Principal Product Manager, Couchbase"},"description":"Prasad Varakur is a Principal Product Manager, Couchbase. Prasad is Product and Engineering leader in Databases(SQL, noSQL, Bigdata) &amp; Distributed systems.","url":"https:\/\/www.couchbase.com\/blog\/author\/prasad-varakur\/"}]}},"authors":[{"term_id":8935,"user_id":70,"is_guest":0,"slug":"prasad-varakur","display_name":"Prasad Varakur, Principal Product Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/3dd2299380c7af4e8a9732a0465d1c082c95eaff26cdf4abf54816d9b693043a?s=96&d=mm&r=g","author_category":"","last_name":"Varakur","first_name":"Prasad","job_title":"","user_url":"","description":"Prasad Varakur is a Principal Product Manager, Couchbase. Prasad is Product and Engineering leader in Databases(SQL, noSQL, Bigdata) &amp; Distributed systems."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2412","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\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2412"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2412\/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=2412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2412"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}