{"id":13258,"date":"2022-05-26T12:05:50","date_gmt":"2022-05-26T19:05:50","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=13258"},"modified":"2025-06-13T23:34:35","modified_gmt":"2025-06-14T06:34:35","slug":"traverse-hierarchy-user-defined-functions-in-7-1","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/traverse-hierarchy-user-defined-functions-in-7-1\/","title":{"rendered":"SQL++ \uc0ac\uc6a9\uc790 \uc815\uc758 \ud568\uc218(UDF)\ub97c \uc0ac\uc6a9\ud55c \ud2b8\ub798\ubc84\uc2a4 \uacc4\uce35 \uad6c\uc870"},"content":{"rendered":"<p><span style=\"font-weight: 400\">\uc0ac\uc6a9\uc790 \uc815\uc758 \ud568\uc218(UDF)\ub294 \ub300\ubd80\ubd84\uc758 RDBMS\uc5d0 \uc874\uc7ac\ud558\ub294 \uae30\ub2a5\uc785\ub2c8\ub2e4. Oracle PL\/SQL(SQL\uc6a9 \ud504\ub85c\uc2dc\uc800\ub7f4 \uc5b8\uc5b4), SQL Server T-SQL(\ud2b8\ub79c\uc7ad\ud2b8-SQL), PL\/pgSQL(\ud504\ub85c\uc2dc\uc800\ub7f4 \uc5b8\uc5b4\/\ud3ec\uc2a4\ud2b8\uadf8\ub808SQL) \ub610\ub294 \uae30\ud0c0 \ubcc0\ud615 \uc5b8\uc5b4\uc5d0 \uad00\uacc4\uc5c6\uc774 \uc774\ub7ec\ud55c \ubaa8\ub4e0 \uc5b8\uc5b4\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \uc77c\ubc18\uc801\uc778 \ud2b9\uc131\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/span><span style=\"font-weight: 400\"> \ube14\ub85d \uad6c\uc870, \uc870\uac74 \uc81c\uc5b4, \ubc18\ubcf5 \ub8e8\ud504 \ubc0f \uc624\ub958 \ucc98\ub9ac\ub85c \uad6c\uc131\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ube4c\ub529 \ube14\ub85d\uc744 \uc0ac\uc6a9\ud558\uba74 \ubcf5\uc7a1\ud55c \uc791\uc5c5\uc744 \uac1c\ubc1c\ud560 \uc218 \uc788\uc73c\uba70, \uc774\ub97c \ubd84\ub9ac\ud558\uc5ec \uc720\uc9c0 \uad00\ub9ac \ubc0f \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ubb34\uacb0\uc131\uc744 \uac1c\uc120\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase\uc758 \uacbd\uc6b0 \uc5b8\uc5b4 \uc120\ud0dd \uae30\uc900\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/sqlplusplus\/\">SQL++<\/a> \uc0ac\uc6a9\uc790 \uc815\uc758 \ud568\uc218\ub294 \ud604\uc7ac RDBMS \uad6c\ud604\uc5d0 \uc874\uc7ac\ud558\ub294 \ubaa8\ub4e0 \uae30\ub2a5\uc744 \uc9c0\uc6d0\ud558\uac70\ub098 Couchbase Query \uc11c\ube44\uc2a4\uc640 \ub3d9\uc77c\ud55c \uc218\uc900\uc73c\ub85c \uc9c0\uc6d0\ud560 \uc218 \uc788\uc5b4\uc57c \ud558\uba70, \uc624\ub298\ub0a0 \uac1c\ubc1c\uc790\uc758 \uc120\ud638\ub3c4\ub3c4 \ubc18\uc601\ud574\uc57c \ud55c\ub2e4\ub294 \uc810\uc774 \ub9e4\uc6b0 \uba85\ud655\ud569\ub2c8\ub2e4. Stack Overflow \uac1c\ubc1c\uc790 \uc124\ubb38\uc870\uc0ac\uc5d0 \ub530\ub974\uba74, 2020\ub144 \ud604\uc7ac \uc804 \uc138\uacc4\uc5d0\uc11c \uac00\uc7a5 \uc77c\ubc18\uc801\uc73c\ub85c \uc0ac\uc6a9\ub418\ub294 \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. <\/span><b>\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8<\/b><span style=\"font-weight: 400\">.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">SQL++ UDF\/JS<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Couchbase\ub294 \uae30\ubcf8\uc801\uc73c\ub85c \ub370\uc774\ud130\ub97c JSON \ud615\uc2dd\uc73c\ub85c \uc800\uc7a5\ud558\ub294 \ubb38\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc785\ub2c8\ub2e4(<\/span><b>J<\/b><span style=\"font-weight: 400\">ava<\/span><b>S<\/b><span style=\"font-weight: 400\">\ud06c\ub9bd\ud2b8 <\/span><b>O<\/b><span style=\"font-weight: 400\">bject <\/span><b>N<\/b><span style=\"font-weight: 400\">otation). \ucffc\ub9ac \uc5b8\uc5b4\uc778 SQL++ \ub294 <em>JSON\uc6a9 SQL<\/em>. \ub530\ub77c\uc11c \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uc5b8\uc5b4\ub294 JSON \ub370\uc774\ud130\uc5d0 \uc561\uc138\uc2a4\ud558\uace0 \uc870\uc791\ud558\ub294 \uac00\uc7a5 \uc790\uc5f0\uc2a4\ub7ec\uc6b4 \ubc29\ubc95\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774\uc5d0 \ub300\ud55c \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ubb38\uc11c\ub97c \ucc38\uc870\ud558\uc138\uc694. <a href=\"https:\/\/docs.couchbase.com\/server\/current\/eventing\/eventing-language-constructs.html\" target=\"_blank\" rel=\"noopener\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4\uc5d0\uc11c \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uc804\uccb4 \uad6c\ud604<\/a>.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">\ud2b8\ub9ac\ub97c \ud6a1\ub2e8\ud558\ub294 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 UDF<\/span><\/h3>\n<p><span style=\"font-weight: 400\">\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\ub294 \uac15\ub825\ud558\uace0 \uc720\uc5f0\ud558\uba70 \ube44\uad50\uc801 \uc27d\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uadf8 \ub2e4\uc7ac\ub2e4\ub2a5\ud568\uc744 \ubcf4\uc5ec\ub4dc\ub9ac\uae30 \uc704\ud574 \uc774 \uae00\uc5d0\uc11c\ub294 \uc870\uc9c1 \uad6c\uc870\uc640 \uac19\uc740 \ud2b8\ub9ac \uad6c\uc870\ub97c \uac00\ub85c\uc9c0\ub974\ub294 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 UDF\ub97c \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p>UDF: <em>\ud2b8\ub798\ubc84\uc2a4 \ud2b8\ub9ac<\/em><\/p>\n<p><span style=\"font-weight: 400\">UDF\ub294 \ub450 \uac00\uc9c0\ub97c \uc0ac\uc6a9\ud558\uc5ec \uceec\ub809\uc158\uc5d0\uc11c \uc7ac\uadc0 \uac80\uc0c9\uc744 \uc218\ud589\ud569\ub2c8\ub2e4. <em>\uc5f0\uacb0<\/em> \ud544\ub4dc(\ub3c4\ucc29 \ubc0f \ucd9c\ubc1c)\ub97c \uc7ac\uadc0\uc5d0 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub9e4\uac1c\ubcc0\uc218\ub294 \ub2e4\uc74c \ud45c\uc5d0 \ub098\uc640 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>#<\/strong><\/td>\n<td><strong>\uc774\ub984<\/strong><\/td>\n<td><strong>\uc124\uba85<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><i><span style=\"font-weight: 400\">kSpace<\/span><\/i><\/td>\n<td><span style=\"font-weight: 400\">\ucffc\ub9ac\uc758 \ud0a4 \uacf5\uac04\uc785\ub2c8\ub2e4. \uceec\ub809\uc158 \ub610\ub294 \ucffc\ub9ac\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2<\/span><\/td>\n<td><i><span style=\"font-weight: 400\">startWith<\/span><\/i><\/td>\n<td><span style=\"font-weight: 400\">\uc774 \uac12\uc73c\ub85c connectToFld\uc5d0 \ub300\ud55c \uac80\uc0c9\uc744 \uc2dc\uc791\ud569\ub2c8\ub2e4. \ube44\uc5b4 \uc788\uc73c\uba74 \ubaa8\ub4e0 connectTo \uac12\uc5d0 \ub300\ud574 \uac80\uc0c9\uc774 \uc218\ud589\ub429\ub2c8\ub2e4.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">3<\/span><\/td>\n<td><i><span style=\"font-weight: 400\">\uc5f0\uacb0 \ub300\uc0c1<\/span><\/i><\/td>\n<td><span style=\"font-weight: 400\">\uceec\ub809\uc158\uc5d0\uc11c connectTo \ud544\ub4dc\uac00 \uc0ac\uc6a9\ub420 \ud544\ub4dc\uc758 \uc774\ub984\uc785\ub2c8\ub2e4.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">4<\/span><\/td>\n<td><i><span style=\"font-weight: 400\">connectFrom<\/span><\/i><\/td>\n<td><span style=\"font-weight: 400\">\uceec\ub809\uc158\uc5d0\uc11c connectFrom \ud544\ub4dc\uac00 \uc0ac\uc6a9\ub420 \ud544\ub4dc\uc758 \uc774\ub984\uc785\ub2c8\ub2e4.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">5<\/span><\/td>\n<td><i><span style=\"font-weight: 400\">\uc5ec\uae30 \ubcf4\uace0\uc11c<\/span><\/i><\/td>\n<td><span style=\"font-weight: 400\">\uacc4\uce35 \ubc30\uc5f4\uc758 \ud544\ub4dc \uc774\ub984\uc785\ub2c8\ub2e4.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">6<\/span><\/td>\n<td><i><span style=\"font-weight: 400\">logKSpace<\/span><\/i><\/td>\n<td><span style=\"font-weight: 400\">UDF\uc5d0 \ub300\ud55c \uc120\ud0dd\uc801 \ub85c\uae45\uc774 \uae30\ub85d\ub418\ub294 \ud0a4 \uacf5\uac04\uc785\ub2c8\ub2e4. \uc774 \ub9e4\uac1c\ubcc0\uc218\ub294 \uc2e4\ud589 \ud568\uc218\uc640 \ud568\uaed8 \uc2e4\ud589\ud560 \ub54c\ub9cc \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"font-weight: 400\">\uacc4\uce35 \uad6c\uc870\uc758 \uc608<\/span><\/h4>\n<p><span style=\"font-weight: 400\">\uc544\ub798\uc640 \uac19\uc740 \uc870\uc9c1 \uacc4\uce35 \uad6c\uc870\ub97c \uace0\ub824\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13260\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/05\/traverse-org-chart-json-sql.png\" alt=\"traverse hierarchical data example\" width=\"307\" height=\"192\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/traverse-org-chart-json-sql.png 307w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/traverse-org-chart-json-sql-300x188.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/traverse-org-chart-json-sql-20x13.png 20w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/p>\n<p><span style=\"font-weight: 400\">\uadf8\ub9ac\uace0 <\/span><em><span style=\"font-weight: 400\">emp<\/span><\/em><span style=\"font-weight: 400\"> \uceec\ub809\uc158\uc5d0\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \ubb38\uc11c\uac00 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:js decode:true\">[\r\n\u00a0 { \"empid\": 1, \"name\": \"JeffC\"\u00a0 \u00a0 },\r\n\u00a0 { \"empid\": 2, \"name\": \"SteveA\",\u00a0 \"reportsTo\": \"JeffC\" \u00a0 },\r\n\u00a0 { \"empid\": 3, \"name\": \"AmitG\", \u00a0 \"reportsTo\": \"JeffC\" \u00a0 },\r\n\u00a0 { \"empid\": 4, \"name\": \"BrendaM\", \"reportsTo\": \"SteveA\"\u00a0 },\r\n\u00a0 { \"empid\": 5, \"name\": \"WillG\", \u00a0 \"reportsTo\": \"SteveA\"\u00a0 },\r\n\u00a0 { \"empid\": 6, \"name\": \"PaulD\", \u00a0 \"reportsTo\": \"BrendaM\" }\r\n]<\/pre>\n<pre class=\"decode-attributes:false lang:default decode:true\">SELECT e.* FROM traverseTree('traversal.hierarchy.emp','','name','reportsTo','ReportHierarchy','') e;<\/pre>\n<p>\ucffc\ub9ac\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \uacb0\uacfc\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"decode-attributes:false lang:js decode:true\">[\r\n\u00a0 {\r\n\u00a0 \u00a0 \"ReportHierarchy\": [],\r\n\u00a0 \u00a0\"name\": \"JeffC\"\r\n\u00a0 },\r\n\u00a0 {\r\n\u00a0 \u00a0 \"ReportHierarchy\": [ { \"level\": 1,\"name\": \"JeffC\" } ],\r\n\u00a0 \u00a0\"name\": \"SteveA\",\r\n\u00a0 \u00a0 \"reportsTo\": \"JeffC\"\r\n\u00a0 },\r\n\u00a0 {\r\n\u00a0 \u00a0 \"ReportHierarchy\": [ { \"level\": 1,\"name\": \"JeffC\" } ],\r\n\u00a0 \u00a0\"name\": \"AmitG\",\r\n\u00a0 \u00a0 \"reportsTo\": \"JeffC\"\r\n\u00a0 },\r\n\u00a0 {\r\n\u00a0 \u00a0 \"ReportHierarchy\": [ { \"level\": 1,\"name\": \"SteveA\",\"reportsTo\": \"JeffC\" },\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 { \"level\": 2,\"name\": \"JeffC\" }\u00a0 ],\r\n\u00a0 \u00a0\u00a0\"name\": \"BrendaM\",\r\n\u00a0 \u00a0 \"reportsTo\": \"SteveA\"\r\n\u00a0 },\r\n\u00a0 {\r\n\u00a0 \u00a0 \"ReportHierarchy\": [ { \"level\": 1,\"name\": \"SteveA\",\"reportsTo\": \"JeffC\" },\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 { \"level\": 2,\"name\": \"JeffC\" }\u00a0 ],\r\n\u00a0 \u00a0 \"name\": \"WillG\",\r\n\u00a0 \u00a0 \"reportsTo\": \"SteveA\"\r\n\u00a0 },\r\n\u00a0 {\r\n\u00a0 \u00a0 \"ReportHierarchy\": [ { \"level\": 1,\"name\": \"BrendaM\",\"reportsTo\": \"SteveA\" },\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 { \"level\": 2,\"name\": \"SteveA\", \"reportsTo\": \"JeffC\"\u00a0 },\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 { \"level\": 3,\"name\": \"JeffC\" }\u00a0 ],\r\n\u00a0 \u00a0\"name\": \"PaulD\",\r\n\u00a0 \u00a0 \"reportsTo\": \"BrendaM\"\r\n\u00a0 }\r\n]\r\n<\/pre>\n<h3><span style=\"font-weight: 400\">\uc0dd\uc131\ud558\uae30 <\/span><em><span style=\"font-weight: 400\">\ud2b8\ub798\ubc84\uc2a4 \ud2b8\ub9ac<\/span><\/em><span style=\"font-weight: 400\"> \uc0ac\uc6a9\uc790 \uc815\uc758 \uae30\ub2a5<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Couchbase SQL++\uc5d0\uc11c\ub294 \uc5ec\ub7ec \uac00\uc9c0 \ubc29\ubc95\uc73c\ub85c UDF\ub97c \uc815\uc758\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\u00a0<\/span><\/p>\n<h5>\uc2a4\uce7c\ub77c \ud568\uc218\ub85c\uc11c\uc758 UDF<\/h5>\n<pre class=\"decode-attributes:false lang:default decode:true\">CREATE FUNCTION to_meters(...) { args[0] * 0.3048 };\r\n\r\nSELECT airportname, ROUND(to_meters(geo.alt)) AS mamsl\r\nFROM `travel-sample`.inventory.airport\r\nLIMIT 5;<\/pre>\n<p>&nbsp;<\/p>\n<h5>\ud558\uc704 \ucffc\ub9ac\uac00 \uc788\ub294 \uc778\ub77c\uc778 \ud568\uc218\ub85c\uc11c<\/h5>\n<pre class=\"decode-attributes:false lang:default decode:true\">CREATE FUNCTION locations(vActivity) { (\r\n\u00a0 SELECT id, name, address, city\r\n\u00a0 FROM `travel-sample`.inventory.landmark\r\n\u00a0 WHERE activity = vActivity) };\r\n\r\nSELECT l.name, l.city\r\nFROM locations(\"eat\") AS l\r\nWHERE l.city = \"Gillingham\";<\/pre>\n<p>&nbsp;<\/p>\n<h5>\uc678\ubd80 \ud568\uc218\ub85c \uc815\uc758<\/h5>\n<p><span style=\"font-weight: 400\">\uadf8\ub9ac\uace0 <em>\ud2b8\ub798\ubc84\uc2a4 \ud2b8\ub9ac<\/em> UDF\ub294 \uc678\ubd80 \ud568\uc218 \uba54\ucee4\ub2c8\uc998\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc774 \uacbd\uc6b0 \ud568\uc218\uc5d0 \ub300\ud55c \uc678\ubd80 \ucf54\ub4dc \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. \ub2e4\uc74c\uc5d0 \ub300\ud55c \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 Couchbase \uc124\uba85\uc11c\ub97c \ucc38\uc870\ud558\uc138\uc694. <a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/userfun.html\" target=\"_blank\" rel=\"noopener\">\uc678\ubd80 \uae30\ub2a5<\/a>.<\/span><\/p>\n<p><span style=\"font-weight: 400\">JavaScript \ud568\uc218 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<p><b>1- \ud568\uc218 \ub77c\uc774\ube0c\ub7ec\ub9ac \uc0dd\uc131<\/b><span style=\"font-weight: 400\"> - \uc774 \uc608\uc81c\uc5d0\uc11c\ub294 \ucffc\ub9ac \uc6cc\ud06c\ubca4\uce58\ub97c \uc0ac\uc6a9\ud558\uc5ec JavaScript \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13261\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/05\/image2-2-1024x235.png\" alt=\"Managing JavaScript function libraries\" width=\"900\" height=\"207\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image2-2-1024x235.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image2-2-300x69.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image2-2-768x177.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image2-2-1536x353.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image2-2-20x5.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image2-2-1320x304.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image2-2.png 1948w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><b>2 - \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ucf54\ub4dc \ucd94\uac00 \ubc0f \ud3b8\uc9d1<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13262\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/05\/image4.png\" alt=\"Editing Couchbase JavaScript code\" width=\"646\" height=\"416\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image4.png 646w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image4-300x193.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image4-20x13.png 20w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/p>\n<p><span style=\"font-weight: 400\">\uc774 [<\/span><a href=\"https:\/\/github.com\/binhquocle\/Coding\/blob\/master\/udfs\/tree.js\"><span style=\"font-weight: 400\">\ub9c1\ud06c<\/span><\/a><span style=\"font-weight: 400\">] \ub97c \ud074\ub9ad\ud558\uba74 \uc804\uccb4 traverseTree \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ub77c\uc774\ube0c\ub7ec\ub9ac \ucf54\ub4dc\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><b>3 - SQL++ \uc0ac\uc6a9\uc790 \uc815\uc758 \ud568\uc218 \ub9cc\ub4e4\uae30<\/b><span style=\"font-weight: 400\">\u00a0<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">CREATE FUNCTION traverseTree(kSpace,startWith, connectTo,\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0connectFrom,reportHier, debugKSpace)\r\n\u00a0 LANGUAGE JAVASCRIPT AS \"traverseTree\" AT \"tree\";<\/pre>\n<p>\ucffc\ub9ac \uc6cc\ud06c\ubca4\uce58\ub97c \uc0ac\uc6a9\ud558\uc5ec UDF\ub97c \ub9cc\ub4e4 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13263\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/05\/image1-3-1024x386.png\" alt=\"Add UDF function in SQL++\" width=\"900\" height=\"339\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image1-3-1024x386.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image1-3-300x113.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image1-3-768x289.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image1-3-1536x579.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image1-3-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image1-3-1320x497.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/05\/image1-3.png 1954w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h3><span style=\"font-weight: 400\">\uc911\uc694 \ucc38\uace0 \uc0ac\ud56d<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Couchbase 7.0\uc5d0\ub294 JavaScript\uc6a9 SQL++ UDF\uac00 \ucd94\uac00\ub418\uc5c8\uc2b5\ub2c8\ub2e4. Couchbase 7.1\uc5d0\ub294 JavaScript \ucf54\ub4dc \ub0b4\uc5d0\uc11c SQL++ DML\uc744 \uc2e4\ud589\ud560 \uc218 \uc788\ub294 \uae30\ub2a5\uc774 \ucd94\uac00\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ub610\ud55c UDF \uad00\ub9ac\ub97c \uc704\ud55c \uba87 \uac00\uc9c0 \ucffc\ub9ac \uc6cc\ud06c\ubca4\uce58 UI \uac1c\uc120 \uc0ac\ud56d\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><b>\uba74\ucc45 \uc870\ud56d <\/b><span style=\"font-weight: 400\">- \uc774 \ubb38\uc11c\uc5d0 \uc81c\uacf5\ub41c \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ucf54\ub4dc\ub294 \uce74\uc6b0\ucf00\uc774\uc2a4 \uc81c\ud488\uc758 \uc77c\ubd80\uac00 \uc544\ub2c8\ub77c\ub294 \uc810\uc5d0 \uc720\uc758\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4. \uc774 \ucf54\ub4dc\ub294 JavaScript\ub97c \uc0ac\uc6a9\ud558\ub294 SQL++ UDF\uc758 \uae30\ub2a5\uc744 \uc124\uba85\ud558\uae30 \uc704\ud55c \ubaa9\uc801\uc73c\ub85c\ub9cc \uc81c\uacf5\ub429\ub2c8\ub2e4. \uc0ac\uc6a9\uc790\ub294 \uc774 \ucf54\ub4dc\uc758 \uc815\ud655\uc131\uc744 \ud655\uc778\ud558\uace0 \ud544\uc694\uc5d0 \ub9de\uac8c \uc218\uc815\ud560 \uac83\uc744 \uad8c\uc7a5\ud569\ub2c8\ub2e4.<\/span><\/p>\n<h3>\ud559\uc2b5 \uacc4\uc18d\ud558\uae30<\/h3>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/downloads\/?family=couchbase-server\" target=\"_blank\" rel=\"noopener\">Couchbase 7.1 \ub2e4\uc6b4\ub85c\ub4dc<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/whats-new-in-couchbase-server-7-1\/\" target=\"_blank\" rel=\"noopener\">Couchbase 7.1\uc758 \uc0c8\ub85c\uc6b4 \uae30\ub2a5<\/a><\/li>\n<li><span style=\"font-weight: 400\"><a href=\"https:\/\/github.com\/binhquocle\/Coding\/blob\/master\/udfs\/tree.js\" target=\"_blank\" rel=\"noopener\">\ud2b8\ub798\ubc84\uc2a4\ud2b8\ub9ac \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ub77c\uc774\ube0c\ub7ec\ub9ac(\ucf54\ub4dc) \uc644\uc131\ud558\uae30<\/a><\/span><\/li>\n<li><span style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/eventing\/eventing-language-constructs.html\" target=\"_blank\" rel=\"noopener\">\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uc774\ubca4\ud2b8 \uc5b8\uc5b4 \uad6c\uc870\uccb4(\ubb38\uc11c)<\/a><\/span><\/li>\n<li><span style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/userfun.html\" target=\"_blank\" rel=\"noopener\">SQL++\uc5d0\uc11c \uc678\ubd80 \ud568\uc218 \uc815\uc758\ud558\uae30(\ubb38\uc11c)<\/a><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>User-defined functions (UDFs) are a feature that exist in most RDBMS. Whether it is Oracle PL\/SQL (Procedural Language for SQL), SQL Server T-SQL (Transact-SQL), PL\/pgSQL (Procedural Language\/PostgreSQL), or other variants, all these languages have the general characteristics of providing a [&hellip;]<\/p>","protected":false},"author":26326,"featured_media":12473,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816,9327,1812],"tags":[9622,1543,8911],"ppma_author":[8919],"class_list":["post-13258","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-javascript","category-n1ql-query","tag-hierarchical-data","tag-javascript","tag-udf"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Traverse Hierarchy with SQL++ User-defined functions (UDFs)<\/title>\n<meta name=\"description\" content=\"In Couchbase 7.1 you can now execute SQL++ DMLs from within the JavaScript UDF code shown in this hierarchy traversal example.\" \/>\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\/ko\/traverse-hierarchy-user-defined-functions-in-7-1\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Traverse Hierarchy with SQL++ User-defined functions (UDFs)\" \/>\n<meta property=\"og:description\" content=\"In Couchbase 7.1 you can now execute SQL++ DMLs from within the JavaScript UDF code shown in this hierarchy traversal example.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/traverse-hierarchy-user-defined-functions-in-7-1\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-26T19:05:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T06:34:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash-1024x683.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"683\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Binh Le\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Binh Le\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/\"},\"author\":{\"name\":\"Binh Le\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/f89064928e262c71eb43bee996c48c63\"},\"headline\":\"Traverse Hierarchy with SQL++ User-defined functions (UDFs)\",\"datePublished\":\"2022-05-26T19:05:50+00:00\",\"dateModified\":\"2025-06-14T06:34:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/\"},\"wordCount\":642,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg\",\"keywords\":[\"hierarchical data\",\"javascript\",\"User Defined Function (UDF)\"],\"articleSection\":[\"Couchbase Server\",\"JavaScript\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/\",\"name\":\"Traverse Hierarchy with SQL++ User-defined functions (UDFs)\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg\",\"datePublished\":\"2022-05-26T19:05:50+00:00\",\"dateModified\":\"2025-06-14T06:34:35+00:00\",\"description\":\"In Couchbase 7.1 you can now execute SQL++ DMLs from within the JavaScript UDF code shown in this hierarchy traversal example.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg\",\"width\":7952,\"height\":5304,\"caption\":\"Creating JavaScript UDFs to traverse hierarchy in Couchbase SQL++\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Traverse Hierarchy with SQL++ User-defined functions (UDFs)\"}]},{\"@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\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@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\/f89064928e262c71eb43bee996c48c63\",\"name\":\"Binh Le\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5b68c37e30928a9d7b2c8470b1a303b7\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g\",\"caption\":\"Binh Le\"},\"description\":\"Binh Le is a Principal Product Manager for Couchbase Query service. Prior to Couchbase, he worked at Oracle and led the product management team for Sales Cloud Analytics and CRM OnDemand. Binh holds a Bachelor's Degree in Computer Science from the University of Brighton, UK.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/ko\/author\/binh-le-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL++ \uc0ac\uc6a9\uc790 \uc815\uc758 \ud568\uc218(UDF)\ub97c \uc0ac\uc6a9\ud55c \ud2b8\ub798\ubc84\uc2a4 \uacc4\uce35 \uad6c\uc870","description":"\uc774\uc81c Couchbase 7.1\uc5d0\uc11c\ub294 \uc774 \uacc4\uce35 \uad6c\uc870 \ud0d0\uc0c9 \uc608\uc81c\uc5d0 \ud45c\uc2dc\ub41c JavaScript UDF \ucf54\ub4dc \ub0b4\uc5d0\uc11c SQL++ DML\uc744 \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.","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\/ko\/traverse-hierarchy-user-defined-functions-in-7-1\/","og_locale":"ko_KR","og_type":"article","og_title":"Traverse Hierarchy with SQL++ User-defined functions (UDFs)","og_description":"In Couchbase 7.1 you can now execute SQL++ DMLs from within the JavaScript UDF code shown in this hierarchy traversal example.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/traverse-hierarchy-user-defined-functions-in-7-1\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-05-26T19:05:50+00:00","article_modified_time":"2025-06-14T06:34:35+00:00","og_image":[{"width":1024,"height":683,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash-1024x683.jpg","type":"image\/jpeg"}],"author":"Binh Le","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Binh Le","Est. reading time":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/"},"author":{"name":"Binh Le","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/f89064928e262c71eb43bee996c48c63"},"headline":"Traverse Hierarchy with SQL++ User-defined functions (UDFs)","datePublished":"2022-05-26T19:05:50+00:00","dateModified":"2025-06-14T06:34:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/"},"wordCount":642,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg","keywords":["hierarchical data","javascript","User Defined Function (UDF)"],"articleSection":["Couchbase Server","JavaScript","SQL++ \/ N1QL Query"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/","url":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/","name":"SQL++ \uc0ac\uc6a9\uc790 \uc815\uc758 \ud568\uc218(UDF)\ub97c \uc0ac\uc6a9\ud55c \ud2b8\ub798\ubc84\uc2a4 \uacc4\uce35 \uad6c\uc870","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg","datePublished":"2022-05-26T19:05:50+00:00","dateModified":"2025-06-14T06:34:35+00:00","description":"\uc774\uc81c Couchbase 7.1\uc5d0\uc11c\ub294 \uc774 \uacc4\uce35 \uad6c\uc870 \ud0d0\uc0c9 \uc608\uc81c\uc5d0 \ud45c\uc2dc\ub41c JavaScript UDF \ucf54\ub4dc \ub0b4\uc5d0\uc11c SQL++ DML\uc744 \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/11\/thisisengineering-raeng-64YrPKiguAE-unsplash.jpg","width":7952,"height":5304,"caption":"Creating JavaScript UDFs to traverse hierarchy in Couchbase SQL++"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/traverse-hierarchy-user-defined-functions-in-7-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Traverse Hierarchy with SQL++ User-defined functions (UDFs)"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","description":"NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4, Couchbase","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":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@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\/f89064928e262c71eb43bee996c48c63","name":"Binh Le","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5b68c37e30928a9d7b2c8470b1a303b7","url":"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g","caption":"Binh Le"},"description":"Binh Le is a Principal Product Manager for Couchbase Query service. Prior to Couchbase, he worked at Oracle and led the product management team for Sales Cloud Analytics and CRM OnDemand. Binh holds a Bachelor's Degree in Computer Science from the University of Brighton, UK.","url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/binh-le-2\/"}]}},"authors":[{"term_id":8919,"user_id":26326,"is_guest":0,"slug":"binh-le-2","display_name":"Binh Le","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g","author_category":"","last_name":"Le","first_name":"Binh","job_title":"","user_url":"","description":"Binh Le\ub294 Couchbase \ucffc\ub9ac \uc11c\ube44\uc2a4\uc758 \uc218\uc11d \uc81c\ud488 \uad00\ub9ac\uc790\uc785\ub2c8\ub2e4. Couchbase\uc5d0 \uc785\uc0ac\ud558\uae30 \uc804\uc5d0\ub294 Oracle\uc5d0\uc11c \uadfc\ubb34\ud558\uba70 Sales Cloud Analytics \ubc0f CRM OnDemand\uc758 \uc81c\ud488 \uad00\ub9ac \ud300\uc744 \uc774\ub04c\uc5c8\uc2b5\ub2c8\ub2e4. \uc601\uad6d \ube0c\ub77c\uc774\ud2bc \ub300\ud559\uad50\uc5d0\uc11c \ucef4\ud4e8\ud130 \uacf5\ud559 \ud559\uc0ac \ud559\uc704\ub97c \ubc1b\uc558\uc2b5\ub2c8\ub2e4."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/13258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/26326"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=13258"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/13258\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/12473"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=13258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=13258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=13258"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=13258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}