{"id":13755,"date":"2022-09-21T16:27:34","date_gmt":"2022-09-21T23:27:34","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=13755"},"modified":"2025-06-13T17:31:58","modified_gmt":"2025-06-14T00:31:58","slug":"from-n1ql-to-javascript-and-back-part-5","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-5\/","title":{"rendered":"N1QL\uc5d0\uc11c JavaScript\ub85c - \ud30c\ud2b8 5: \uc900\ube44\ub41c \ubb38"},"content":{"rendered":"<p>\uc774\uc804 \ube14\ub85c\uadf8\uc5d0\uc11c\ub294 JavaScript\uc5d0\uc11c N1QL(SQL++)\uc744 \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc124\uba85\ud588\uc2b5\ub2c8\ub2e4. <a href=\"https:\/\/blog.couchbase.com\/from-n1ql-to-javascript-and-back-part-1-introduction\/\" target=\"_blank\" rel=\"noopener\">\ud568\uc218<\/a>\ubb38\uc11c \ucc98\ub9ac\u00a0<a href=\"https:\/\/blog.couchbase.com\/from-n1ql-to-javascript-and-back-part-3\/\" target=\"_blank\" rel=\"noopener\">\ubc18\ubcf5\uae30\ub97c \ud1b5\ud574<\/a>, <a href=\"https:\/\/blog.couchbase.com\/from-n1ql-to-javascript-and-back-part-2\/\" target=\"_blank\" rel=\"noopener\">\ub370\uc774\ud130 \uc870\uc791<\/a>\ubc0f <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-4\/\" target=\"_blank\" rel=\"noopener\">\uc624\ub958 \ucc98\ub9ac<\/a>.<\/p>\n<p><span style=\"font-weight: 400;\">\uc774\uc81c \ub2e4\uc74c\uc73c\ub85c \uc774\ub3d9\ud569\ub2c8\ub2e4. <strong>\ub3d9\uc801 \ubb38 \uc2e4\ud589<\/strong>.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">\uc900\ube44\ub41c \uc9c4\uc220\uc11c<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\uc608\ub97c \ub4e4\uc5b4 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ud568\uc218\ub294 \ub2e4\ub978 \uc694\uccad\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c \uc900\ube44\ub41c \ubb38\uc744 \uc900\ube44\ud558\uace0 \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doPrepare() {\r\n\u00a0\u00a0\u00a0\u00a0var p = prepare a from select * from b1;\r\n\u00a0\u00a0\u00a0\u00a0var q = execute a;\r\n\u00a0\u00a0\u00a0\u00a0var res = [];\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<pre class=\"lang:default decode:true\">CREATE FUNCTION doPrepare() LANGUAGE JAVASCRIPT AS \"doPrepare\" AT \"udfblog\"<\/pre>\n<p><span style=\"font-weight: 400;\">\uc900\ube44\ub41c \ubb38\uc744 \uc900\ube44\ud558\uace0 \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uae30 \uc804\uc5d0 N1QL \uc900\ube44\ub41c \ubb38\uc5d0 \ub300\ud574 \uba87 \uac00\uc9c0 \uc5b8\uae09\ud574\uc57c \ud560 \uac83 \uac19\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">N1QL \uc900\ube44\ub41c \ubb38\uc740 \uc694\uccad\uc5d0 \ub300\ud574 \ube44\uacf5\uac1c\uac00 \uc544\ub2c8\ub77c \uc804\uccb4 \ub178\ub4dc\uc5d0\uc11c \uacf5\uc720\ub429\ub2c8\ub2e4. \ub2e4\ub978 \uc0ac\ub78c\uc774 \uc774\uc804\uc5d0 \uc900\ube44\ud55c \ubb38\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\uc740 \ubd84\uba85\ud788 \uac00\ub2a5\ud558\uba70, \uc624\ud788\ub824 \uad8c\uc7a5\ub429\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uc989, \uc900\ube44\ub41c \uba85\ub839\ubb38 \uc774\ub984\uc758 \ubc94\uc704\ub294 <em>\ucffc\ub9ac_\ucee8\ud14d\uc2a4\ud2b8<\/em> \uc0dd\uc131 \uc2dc\uc810\uc5d0 \uc0ac\uc6a9\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uac19\uc740 \uc774\ub984\uc744 \uac00\uc9c4 \ub450 \uac1c\uc758 \ubb38\uc774 \ub3d9\uc77c\ud55c <em>\ucffc\ub9ac_\ucee8\ud14d\uc2a4\ud2b8.<\/em><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uc900\ube44 \uc2dc\uc810\uc5d0 N1QL\uc774 \uc774\ub984\uc744 \ud560\ub2f9\ud558\ub3c4\ub85d \ud558\uba74 \uc900\ube44\ub41c \ubb38\uc740 \ub2e4\ub978 \uad00\uacc4\ud615 \uc5d4\uc9c4\uacfc \ud06c\uac8c \ub2e4\ub974\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uc774\ub984\uc744 \uc9c1\uc811 \uc9c0\uc815\ud558\ub294 \uacbd\uc6b0, \uc774\ub984\uc744 \uace0\uc720\ud558\uac8c \uc720\uc9c0\ud574\uc57c \ud55c\ub2e4\ub294 \uc810\uc5d0 \uc720\uc758\ud558\uc138\uc694. <em>\ucffc\ub9ac_\ucee8\ud14d\uc2a4\ud2b8<\/em> \uc694\uccad\uc5d0 \ub530\ub77c \uc124\uc815\ud569\ub2c8\ub2e4. \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc811\ub450\uc0ac\uc640 \uac19\uc740 \uace0\uc720\ud55c \uba85\uba85 \uccb4\uacc4\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\ub610\ud55c \uc774\ubbf8 \uc874\uc7ac\ud558\ub294 \uc9c4\uc220\uc11c\ub97c \uc791\uc131\ud558\ub294 \uacbd\uc6b0 \uc9c4\uc220\uc11c \ud14d\uc2a4\ud2b8\ub294 \uae30\uc874 \uc9c4\uc220\uc11c\uc758 \ud14d\uc2a4\ud2b8\uc640 \uc77c\uce58\ud574\uc57c \ud569\ub2c8\ub2e4. \uc774\ub294 \ub2e4\ub978 \uc0ac\ub78c \ubab0\ub798 \uc900\ube44\ub41c \ubb38\uc7a5\uc758 \uc758\ubbf8\ub97c \ubcc0\uacbd\ud558\ub294 \uac83\uc744 \ubc29\uc9c0\ud558\uae30 \uc704\ud55c \uac83\uc785\ub2c8\ub2e4.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ud568\uc218\uc758 \uc900\ube44\ub41c \ubb38\uc73c\ub85c \ub3cc\uc544\uac00\uae30!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uc9c4\uc220\uc11c \uc791\uc131 \ubc0f \uc2e4\ud589<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uc0ac\uc6a9\ud560 \ub2e4\ub978 \ud568\uc218\/\uc694\uccad\uc5d0 \ub300\ud55c \ubb38\uc744 \uc900\ube44\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uae30\uc874 \ubb38\uc744 \uc2e4\ud589\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\ud568\uc218 \ub9e4\uac1c\ubcc0\uc218\ub85c \uc804\ub2ec\ub41c \ubb38\uc744 \uc2e4\ud589\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4(\ucf54\ub4dc \uc0bd\uc785\uacfc \uac19\uc774 \uc704\ud5d8\ud560 \uc218 \uc788\uc9c0\ub9cc).<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">\uc900\ube44 \ubc0f \uc2e4\ud589<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">\uc774\uc804 \uc608\uc81c\uc5d0\uc11c \uc774\ubbf8 \uba85\uba85\ub41c \ubb38\uc744 \uc900\ube44\ud558\uace0 \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uc558\uc73c\ubbc0\ub85c \uc774\uc81c \uc775\uba85\uc73c\ub85c \uc900\ube44\ub41c \ubb38\uc744 \uc900\ube44\ud558\uace0 \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uba54\uc778\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \uacb0\uacfc\ub97c \ucc98\ub9ac\ud574\uc57c \ud569\ub2c8\ub2e4. <em>\uc900\ube44<\/em> \ubb38\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc774\ub984\uc744 \ucd94\ucd9c\ud558\uace0 <em>\uc2e4\ud589<\/em> \ubb38\uacfc \uac19\uc740 \uc2dd\uc73c\ub85c\uc694:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doPrepare() {\r\n\u00a0\u00a0\u00a0\u00a0var p = prepare select * from b1;\r\n\u00a0\u00a0\u00a0\u00a0var iter = p[Symbol.iterator]();\r\n\u00a0\u00a0\u00a0\u00a0var prep = iter.next().value;\r\n\u00a0\u00a0\u00a0\u00a0p.close();\r\n\u00a0\u00a0\u00a0\u00a0var q = N1QL(\"execute \\\"\" + prep.name + \"\\\"\");\r\n\u00a0\u00a0\u00a0\u00a0var res = [];\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">\uc704\uc758 \uc608\uc2dc\ub294 \ubc18\ubcf5\uc790\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\ub3c4 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4. \ubcf4\uae30 \ud749\ud558\ub2e4\uba74 \uc900\ube44 \uacb0\uacfc\ub97c \ubc18\ubcf5\ud558\uc5ec \uc774\ub984\uc744 \uac00\uc838\uc62c \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doPrepare() {\r\n\u00a0\u00a0\u00a0\u00a0var p = prepare select * from b1;\r\n\u00a0\u00a0\u00a0\u00a0for (prep of p);\r\n\u00a0\u00a0\u00a0\u00a0var q = N1QL(\"execute \\\"\" + prep.name + \"\\\"\");\r\n\u00a0\u00a0\u00a0\u00a0var res = [];\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">\uc704\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \uc774\uc720\ub85c \uc791\ub3d9\ud569\ub2c8\ub2e4. <em>\uc900\ube44<\/em> \ub294 \ud558\ub098\uc758 \ubb38\uc11c, \uc900\ube44\ub41c \ubb38 \uacc4\ud68d \ubc0f \ubcc0\uc218 \ubc94\uc704\ub9cc \ubc18\ud658\ud569\ub2c8\ub2e4. <\/span><span style=\"font-weight: 400;\">\uc900\ube44<\/span><span style=\"font-weight: 400;\"> \uc5d0 \uc120\uc5b8\ub41c <em>\uc5d0 \ub300\ud55c<\/em> \ub8e8\ud504\ub294 \uc2e4\uc81c \ud568\uc218\uc774\ubbc0\ub85c \ub8e8\ud504 \uc790\uccb4\uc758 \ub05d\uc744 \uc9c0\ub098\uc11c \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uacf5\uc815\ud558\uac8c \ub9d0\ud558\uc790\uba74 \ub450 \uc608 \ubaa8\ub450 \ud2b9\ubcc4\ud788 \uc6b0\uc544\ud574 \ubcf4\uc774\uc9c0\ub294 \uc54a\uc9c0\ub9cc \uc5ec\uc804\ud788 \uadf8\ub807\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc8fc\uc758\ud574\uc57c \ud560 \uc810\uc740 <em>\uc2e4\ud589<\/em> \ub294 \ub9e4\uac1c \ubcc0\uc218\ub97c \ud5c8\uc6a9\ud558\uc9c0 \uc54a\uc73c\ubbc0\ub85c \ubb38 \ubb38\uc790\uc5f4\uc744 \uad6c\uc131\ud574\uc57c \ud558\uba70, \uc774\ub294 \uace7 <em>N1QL()<\/em> \ud568\uc218\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774 \ud2b9\uc815 \uc608\uc81c\uc5d0\uc11c\ub294 \ubb38\uc81c\uac00 \ub418\uc9c0 \uc54a\uc9c0\ub9cc, \ud55c\ud3b8\uc73c\ub85c\ub294 \ubd84\uc0b0 \ud615\uc2dd\uc73c\ub85c \uc9c0\uc815\ub41c \ubb38 \uc774\ub984\uc744 \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ud558\uae30 \uc704\ud574 \ubb38 \uc774\ub984\uc744 \ub530\uc634\ud45c\ub85c \ubb36\ub294 \uac83\uc774 \uac00\uc7a5 \uc88b\uc9c0\ub9cc, \ub354 \uc911\uc694\ud55c \uac83\uc740 N1QL \uc8fc\uc785\uc758 \uc704\ud5d8\uc744 \ud53c\ud558\uae30 \uc704\ud574 \ubb38 \uc774\ub984\uc774 \ud568\uc218\uc5d0 \ub9e4\uac1c \ubcc0\uc218\ub85c \uc804\ub2ec\ub418\uc5c8\ub2e4\uace0 \uac00\uc815\ud560 \ub54c\uc785\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doExecuteName(name) {\r\n\u00a0\u00a0\u00a0\u00a0var q = N1QL(\"execute \" + name);\r\n\u00a0\u00a0\u00a0\u00a0var res = [];\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<pre class=\"lang:default decode:true\">CREATE FUNCTION doExecuteName(name) LANGUAGE JAVASCRIPT AS \"doExecuteName\" AT \"udfblog\"<\/pre>\n<p><span style=\"font-weight: 400;\">\uc545\uc758\uc801\uc778 \uc0ac\uc6a9\uc790\uac00 \uc2e4\ud589\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">execute function doExecute(\"function doSomethingNasty()\")<\/pre>\n<p><span style=\"font-weight: 400;\">\uc774\ub984\uc744 \ub530\uc634\ud45c\ub85c \ubb36\uc9c0 \uc54a\uc558\ub2e4\uba74 \uc900\ube44\ub41c \ubb38\uc7a5\uc774 \uc544\ub2c8\ub77c \uc7a0\uc7ac\uc801\uc73c\ub85c \uc704\ud5d8\ud55c \ud568\uc218\ub97c \uc2e4\ud589\ud588\uc744 \uac83\uc785\ub2c8\ub2e4!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774\ub807\uac8c \ud558\uba74 \uc704\ud5d8\uc744 \ud53c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doExecuteName(name) {\r\n\u00a0\u00a0\u00a0\u00a0var q = N1QL(\"execute \\\"\" + name + \"\\\"\");\r\n\u00a0\u00a0\u00a0\u00a0var res = [];\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<h3><span style=\"font-weight: 400;\">EXECUTE \ubb38\uc5d0 \uc790\ub9ac \ud45c\uc2dc\uc790 \uac12 \uc804\ub2ec\ud558\uae30<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">\uc900\ube44\ub41c \ubb38\uc744 \uc2e4\ud589\ud560 \ub54c \uc790\ub9ac \ud45c\uc2dc\uc790 \uac12\uc744 \uc804\ub2ec\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc704\uce58 \uc790\ub9ac \ud45c\uc2dc\uc790\uc758 \uacbd\uc6b0, \uc774\uac83\uc740 \uc900\ube44\ub418\uc9c0 \uc54a\uc740 \ubb38\uacfc \uc2e4\uc81c\ub85c \ub2e4\ub974\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. <em>N1QL()<\/em> \ud568\uc218, \uc608\ub97c \ub4e4\uc5b4<\/span><\/p>\n<pre class=\"lang:default decode:true\">PREPARE s1 FROM SELECT * FROM b1 WHERE f1 &gt; $1;<\/pre>\n<pre class=\"lang:js decode:true\">function doExecute() {\r\n\u00a0\u00a0\u00a0\u00a0var q = N1QL(\"execute s1\", [1]);\r\n\u00a0\u00a0\u00a0\u00a0var res = [];\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<pre class=\"lang:default decode:true\">CREATE FUNCTION doExecute() LANGUAGE JAVASCRIPT AS \"doExecute\" AT \"udfblog\"<\/pre>\n<p><span style=\"font-weight: 400;\">\uba85\uba85\ub41c \ub9e4\uac1c\ubcc0\uc218\uc640 \uad00\ub828\ud558\uc5ec \uace0\ub824\ud574\uc57c \ud560 \uc0ac\ud56d\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\ud2b8\ub79c\uc2a4\ud30c\uc77c\ub7ec\ub294 \uc900\ube44\ub41c \ubb38 \ud14d\uc2a4\ud2b8\uc5d0 \ub300\ud55c \uac00\uc2dc\uc131\uc774 \uc5c6\uc73c\uba70, \uad6c\ubb38 \ubd84\uc11d \ubc0f \uc7ac\uc791\uc131\ud558\ub294 \uac83\uc740 EXECUTE \ubb38\uc77c \ubfd0\uc785\ub2c8\ub2e4. \ub530\ub77c\uc11c \ud2b8\ub79c\uc2a4\ud30c\uc77c\ub7ec\ub294 \uc5b4\ub5a4 \ubcc0\uc218 \uc774\ub984\uc744 \uc0ac\uc6a9\ud558\uc5ec <em>N1QL()<\/em> \ud638\ucd9c\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uadf8\ub9ac\uace0 <\/span><span style=\"font-weight: 400;\"><em>\uc2e4\ud589 ... \uc0ac\uc6a9<\/em> <\/span><span style=\"font-weight: 400;\">\ubb38\uc5d0\uc11c \uc815\uc801 \uac12\ub9cc \ud5c8\uc6a9\ud569\ub2c8\ub2e4. <\/span><em><span style=\"font-weight: 400;\">\uc0ac\uc6a9<\/span><\/em><span style=\"font-weight: 400;\"> \uc808\uc5d0 \uc815\uc758\ub41c \ub9e4\uac1c\ubcc0\uc218\uc640 \uc694\uccad \ubcf8\ubb38\uc5d0 \uc815\uc758\ub41c \ub9e4\uac1c\ubcc0\uc218 \uc0ac\uc774\uc758 \ubaa8\ud638\uc131\uc744 \ud53c\ud558\uae30 \uc704\ud55c \uac83\uc785\ub2c8\ub2e4. <\/span><em><span style=\"font-weight: 400;\">\uc0ac\uc6a9<\/span><\/em><span style=\"font-weight: 400;\"> \uc808\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\uacb0\uacfc\uc801\uc73c\ub85c \uc815\uc801 \uac12(\ubb38\uc790\uc5f4, \uc22b\uc790 \ub4f1)\uc744 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub294 \ud55c, \uc5ec\uae30\uc11c <\/span><em><span style=\"font-weight: 400;\">\uc2e4\ud589 ... \uc0ac\uc6a9<\/span><\/em><span style=\"font-weight: 400;\"> \uac00 \uc2e4\ud589 \uac00\ub2a5\ud55c \uc635\uc158(\uba85\uba85\ub41c \ub9e4\uac1c \ubcc0\uc218\uc758 \uacbd\uc6b0\uc5d0\ub3c4)\uc774 \ub420 \uc218 \uc788\uc9c0\ub9cc, \ud604\uc7ac \uc2e4\ud589 \uac00\ub2a5\ud55c \uc720\uc77c\ud55c \uc635\uc158\uc740 <em>N1QL()<\/em> \ud568\uc218\uc785\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:default decode:true\">PREPARE s2 FROM SELECT * FROM b1 WHERE f1 &gt; $min;<\/pre>\n<pre class=\"lang:js decode:true\">function doExecute() {\r\n\u00a0\u00a0\u00a0\u00a0var q = N1QL(\"execute s2\", {min: 1});\r\n\u00a0\u00a0\u00a0\u00a0var res = [];\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">\uc774\ud6c4 \ub9b4\ub9ac\uc2a4\uc5d0\uc11c\ub294 \ud2b8\ub79c\uc2a4\ud30c\uc77c\ub7ec\uac00 \ud655\uc7a5\ub418\uc5b4 \ub2e4\uc74c\uc744 \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <\/span><em><span style=\"font-weight: 400;\">\uc2e4\ud589<\/span><\/em><span style=\"font-weight: 400;\"> \ubb38\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">\uc900\ube44\ub41c \ubb38 \ubc0f \ub8e8\ud504<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">\ub2e4\uc74c \ud568\uc218\ub97c \uace0\ub824\ud558\uc138\uc694:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doCopyField() {\r\n\u00a0\u00a0\u00a0\u00a0var q = SELECT * FROM b1 WHERE f1 IS NOT MISSING;\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var i = INSERT INTO b1 VALUES(UUID(), { \"f2\": $doc.b1.f1 });\r\n\u00a0\u00a0\u00a0\u00a0}\r\n}<\/pre>\n<pre class=\"lang:default decode:true\">CREATE FUNCTION doCopyField() LANGUAGE JAVASCRIPT AS \"doCopyField\" AT \"udfblog\"<\/pre>\n<p><span style=\"font-weight: 400;\">\uc774 \ud568\uc218\uac00 \uc218\ud589\ud558\ub294 \uc791\uc5c5\uc740 <\/span><em><span style=\"font-weight: 400;\">\uc0bd\uc785<\/span><\/em><span style=\"font-weight: 400;\"> \ubb38\uc744 \uac80\uc0c9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774\ub97c \uc704\ud574\uc11c\ub294 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uc6cc\ucee4\uac00 N1QL \uc11c\ube44\uc2a4\uc5d0 \uad6c\ubb38\uc744 \ubd84\uc11d\ud558\uace0 <\/span><em><span style=\"font-weight: 400;\">\uc0bd\uc785<\/span><\/em><span style=\"font-weight: 400;\"> \ubb38\uc744 \uac80\uc0c9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ub354 \uc88b\uc740 \ubc29\ubc95\uc740 \uc900\ube44\ub41c \ubb38\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\uc785\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doCopyField() {\r\n\u00a0\u00a0\u00a0\u00a0var p = PREPARE ins FROM INSERT INTO b1 VALUES(UUID(), {\"f2\": $1});\r\n\u00a0\u00a0\u00a0\u00a0var q = SELECT * FROM b1 WHERE f1 IS NOT MISSING;\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var i = N1QL(\"EXECUTE ins\", [doc.b1.f1]);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n}<\/pre>\n<h2><span style=\"font-weight: 400;\">\uacb0\ub860<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\uc774\uc81c JavaScript \ud568\uc218 \ub0b4\uc5d0\uc11c N1QL \ubb38\uc744 \uc2e4\ud589\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc218\uc9d1\ud558\uace0 \uc870\uc791\ud558\ub294 \ubaa8\ub4e0 \uac00\ub2a5\ud55c \ubc29\ubc95\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ub2e4\uc74c\uc73c\ub85c \ub2e4\uc74c\uacfc \uac19\uc740 \uba87 \uac00\uc9c0 \uace0\uae09 \uc8fc\uc81c\ub97c \ub2e4\ub8f9\ub2c8\ub2e4. <strong>\uc911\ucca9 \ud568\uc218 \ud638\ucd9c<\/strong>, <strong>\ubcf4\uc548<\/strong> \uadf8\ub9ac\uace0 <strong>\uac70\ub798<\/strong>.<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>In previous blogs, we covered executing N1QL (SQL++) from JavaScript functions, processing documents\u00a0through iterators, manipulating data. and handling errors. We now move to executing dynamic statements. Prepared statements JavaScript functions can prepare and execute prepared statements, much like any request [&hellip;]<\/p>","protected":false},"author":1782,"featured_media":13756,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814,1816,2273,1812,2201],"tags":[2133,9717,8911],"ppma_author":[8924],"class_list":["post-13755","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-couchbase-server","category-eventing","category-n1ql-query","category-tools-sdks","tag-functions","tag-prepared-statements","tag-udf"],"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>From N1QL to JavaScript and Back - Part 5: Prepared statements - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Continuing our series, we turn to all the ways to gather and manipulate data by executing SQL++\/N1QL statements within JavaScript functions.\" \/>\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\/from-n1ql-to-javascript-and-back-part-5\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"From N1QL to JavaScript and Back - Part 5: Prepared statements\" \/>\n<meta property=\"og:description\" content=\"Continuing our series, we turn to all the ways to gather and manipulate data by executing SQL++\/N1QL statements within JavaScript functions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-5\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-21T23:27:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T00:31:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1333\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Marco Greco, Software Architect, 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=\"Marco Greco, Software Architect, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/\"},\"author\":{\"name\":\"Marco Greco, Software Architect, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/2b5184a7cdb443ff2897aff0866cd6fd\"},\"headline\":\"From N1QL to JavaScript and Back &#8211; Part 5: Prepared statements\",\"datePublished\":\"2022-09-21T23:27:34+00:00\",\"dateModified\":\"2025-06-14T00:31:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/\"},\"wordCount\":810,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg\",\"keywords\":[\"functions\",\"prepared statements\",\"User Defined Function (UDF)\"],\"articleSection\":[\"Application Design\",\"Couchbase Server\",\"Eventing\",\"SQL++ \/ N1QL Query\",\"Tools &amp; SDKs\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/\",\"name\":\"From N1QL to JavaScript and Back - Part 5: Prepared statements - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg\",\"datePublished\":\"2022-09-21T23:27:34+00:00\",\"dateModified\":\"2025-06-14T00:31:58+00:00\",\"description\":\"Continuing our series, we turn to all the ways to gather and manipulate data by executing SQL++\/N1QL statements within JavaScript functions.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg\",\"width\":2000,\"height\":1333,\"caption\":\"Create prepared statements in JavaScript with SQL++ \/ N1QL\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"From N1QL to JavaScript and Back &#8211; Part 5: Prepared statements\"}]},{\"@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\/2b5184a7cdb443ff2897aff0866cd6fd\",\"name\":\"Marco Greco, Software Architect, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/707c967b795fd71b6330f6d3118cf308\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e6be0ee56851d2f71a554731d5edd5c820069680f0a810b47f094091c58bc553?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e6be0ee56851d2f71a554731d5edd5c820069680f0a810b47f094091c58bc553?s=96&d=mm&r=g\",\"caption\":\"Marco Greco, Software Architect, Couchbase\"},\"description\":\"In a previous life, Marco used to be CTO, radiation physicist, software architect, sysadmin, DBA, trainer and general handyman at Italy's largest radiation theraphy practice. Having switched career and country, he spent more than two decades in various support and development positions in Informix first and IBM later, before finally taking the plunge and joining Couchbase, to help them make gold out of N1QL. He holds several patents and has authored open source projects of his own.\",\"sameAs\":[\"https:\/\/github.com\/marcogrecopriolo\",\"https:\/\/www.linkedin.com\/in\/marco-greco-7665308\/\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/ko\/author\/marcocouchbase-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"From N1QL to JavaScript and Back - Part 5: Prepared statements - The Couchbase Blog","description":"\uc2dc\ub9ac\uc988\ub97c \uc774\uc5b4\uac00\uba74\uc11c \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ud568\uc218 \ub0b4\uc5d0\uc11c SQL++\/N1QL \ubb38\uc744 \uc2e4\ud589\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc218\uc9d1\ud558\uace0 \uc870\uc791\ud558\ub294 \ubaa8\ub4e0 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubd05\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\/from-n1ql-to-javascript-and-back-part-5\/","og_locale":"ko_KR","og_type":"article","og_title":"From N1QL to JavaScript and Back - Part 5: Prepared statements","og_description":"Continuing our series, we turn to all the ways to gather and manipulate data by executing SQL++\/N1QL statements within JavaScript functions.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-5\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-09-21T23:27:34+00:00","article_modified_time":"2025-06-14T00:31:58+00:00","og_image":[{"width":2000,"height":1333,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg","type":"image\/jpeg"}],"author":"Marco Greco, Software Architect, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marco Greco, Software Architect, Couchbase","Est. reading time":"5\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/"},"author":{"name":"Marco Greco, Software Architect, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/2b5184a7cdb443ff2897aff0866cd6fd"},"headline":"From N1QL to JavaScript and Back &#8211; Part 5: Prepared statements","datePublished":"2022-09-21T23:27:34+00:00","dateModified":"2025-06-14T00:31:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/"},"wordCount":810,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg","keywords":["functions","prepared statements","User Defined Function (UDF)"],"articleSection":["Application Design","Couchbase Server","Eventing","SQL++ \/ N1QL Query","Tools &amp; SDKs"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/","url":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/","name":"From N1QL to JavaScript and Back - Part 5: Prepared statements - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg","datePublished":"2022-09-21T23:27:34+00:00","dateModified":"2025-06-14T00:31:58+00:00","description":"\uc2dc\ub9ac\uc988\ub97c \uc774\uc5b4\uac00\uba74\uc11c \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ud568\uc218 \ub0b4\uc5d0\uc11c SQL++\/N1QL \ubb38\uc744 \uc2e4\ud589\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc218\uc9d1\ud558\uace0 \uc870\uc791\ud558\ub294 \ubaa8\ub4e0 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubd05\ub2c8\ub2e4.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/09\/sql-n1ql-prepared-statements-part5.jpg","width":2000,"height":1333,"caption":"Create prepared statements in JavaScript with SQL++ \/ N1QL"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"From N1QL to JavaScript and Back &#8211; Part 5: Prepared statements"}]},{"@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\/2b5184a7cdb443ff2897aff0866cd6fd","name":"\ub9c8\ub974\ucf54 \uadf8\ub808\ucf54, \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uc544\ud0a4\ud14d\ud2b8, \uce74\uc6b0\uce58\ubca0\uc774\uc2a4","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/707c967b795fd71b6330f6d3118cf308","url":"https:\/\/secure.gravatar.com\/avatar\/e6be0ee56851d2f71a554731d5edd5c820069680f0a810b47f094091c58bc553?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e6be0ee56851d2f71a554731d5edd5c820069680f0a810b47f094091c58bc553?s=96&d=mm&r=g","caption":"Marco Greco, Software Architect, Couchbase"},"description":"In a previous life, Marco used to be CTO, radiation physicist, software architect, sysadmin, DBA, trainer and general handyman at Italy's largest radiation theraphy practice. Having switched career and country, he spent more than two decades in various support and development positions in Informix first and IBM later, before finally taking the plunge and joining Couchbase, to help them make gold out of N1QL. He holds several patents and has authored open source projects of his own.","sameAs":["https:\/\/github.com\/marcogrecopriolo","https:\/\/www.linkedin.com\/in\/marco-greco-7665308\/"],"url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/marcocouchbase-com\/"}]}},"authors":[{"term_id":8924,"user_id":1782,"is_guest":0,"slug":"marcocouchbase-com","display_name":"Marco Greco, Software Architect, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/e6be0ee56851d2f71a554731d5edd5c820069680f0a810b47f094091c58bc553?s=96&d=mm&r=g","author_category":"","last_name":"Greco","first_name":"Marco","job_title":"","user_url":"","description":"\uc804\uc0dd\uc5d0 \ub9c8\ub974\ucf54\ub294 \uc774\ud0c8\ub9ac\uc544 \ucd5c\ub300 \ubc29\uc0ac\uc120 \uce58\ub8cc \uae30\uad00\uc5d0\uc11c CTO, \ubc29\uc0ac\uc120 \ubb3c\ub9ac\ud559\uc790, \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uc124\uacc4\uc790, \uc2dc\uc2a4\ud15c \uad00\ub9ac\uc790, DBA, \ud2b8\ub808\uc774\ub108, \uc77c\ubc18 \uad00\ub9ac\uc790\ub85c \uc77c\ud588\uc2b5\ub2c8\ub2e4.\r\n\r\n\uc9c1\uc5c5\uacfc \uad6d\uac00\ub97c \ubc14\uafbc \uadf8\ub294 \ucc98\uc74c\uc5d0\ub294 Informix\uc5d0\uc11c, \ub098\uc911\uc5d0\ub294 IBM\uc5d0\uc11c 20\ub144 \uc774\uc0c1 \ub2e4\uc591\ud55c \uc9c0\uc6d0 \ubc0f \uac1c\ubc1c \uc9c1\ucc45\uc744 \ub9e1\ub2e4\uac00 \ub9c8\uce68\ub0b4 \uacfc\uac10\ud788 Couchbase\uc5d0 \ud569\ub958\ud558\uc5ec N1QL\uc5d0\uc11c \uae08\uc744 \ub9cc\ub4dc\ub294 \ub370 \ub3c4\uc6c0\uc744 \uc8fc\uc5c8\uc2b5\ub2c8\ub2e4.\r\n\r\n\uadf8\ub294 \uc5ec\ub7ec \uac1c\uc758 \ud2b9\ud5c8\ub97c \ubcf4\uc720\ud558\uace0 \uc788\uc73c\uba70 \uc9c1\uc811 \uc624\ud508 \uc18c\uc2a4 \ud504\ub85c\uc81d\ud2b8\ub97c \uc800\uc220\ud558\uae30\ub3c4 \ud588\uc2b5\ub2c8\ub2e4."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/13755","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\/1782"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=13755"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/13755\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/13756"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=13755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=13755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=13755"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=13755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}