{"id":13635,"date":"2022-08-04T16:02:15","date_gmt":"2022-08-04T23:02:15","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=13635"},"modified":"2025-06-13T17:20:44","modified_gmt":"2025-06-14T00:20:44","slug":"from-n1ql-to-javascript-and-back-part-3","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-3\/","title":{"rendered":"N1QL\uc5d0\uc11c JavaScript\ub85c - 3\ubd80: \ubb38\uc11c\uc640 DML \ubc18\ubcf5\ud558\uae30"},"content":{"rendered":"<p><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-2\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">\uc774 \uc774\uc804 \ube14\ub85c\uadf8<\/span><\/a><span style=\"font-weight: 400;\"> \uc5d0\uc11c\ub294 JavaScript \ud568\uc218 \ub0b4\uc5d0\uc11c N1QL \ubb38\uc744 \uc2e4\ud589\ud558\ub294 \uae30\ubcf8 \uc0ac\ud56d\uc744 \uc0b4\ud3b4\ubd05\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774\uc81c \ub2e4\uc74c\uc73c\ub85c \uc774\ub3d9\ud569\ub2c8\ub2e4...<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">\uc774\ud130\ub808\uc774\ud130\/\ucc98\ub9ac \uac12<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\uc9c0\uae08\uae4c\uc9c0\ub294 \ub370\uc774\ud130\ub97c \ubc18\ud658\ud558\ub294 \ubb38\uacfc \ud568\uc218\uc5d0\uc11c \ub370\uc774\ud130\ub97c \ubc18\ud658\ud558\ub294 \ubb38\uc740 \uc758\ub3c4\uc801\uc73c\ub85c \ud53c\ud588\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc5ec\uae30\uc11c\ubd80\ud130 \ub370\uc774\ud130 \uc218\uc9d1\uc5d0 \ub300\ud55c \ud0d0\uc0c9\uc774 \uc2dc\uc791\ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uadf8\ub9ac\uace0 <em>N1QL()<\/em> \ud568\uc218\ub97c \uc9c1\uc811 \ucc38\uc870\ud558\uac70\ub098 \ud2b8\ub79c\uc2a4\ud30c\uc77c\ub7ec \ub9e4\uc9c1\uc73c\ub85c \ucc38\uc870\ud558\uba74 \ubb38 \ud578\ub4e4\uc744 \ubc18\ud658\ud569\ub2c8\ub2e4. \ud578\ub4e4\uc740 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \uac1d\uccb4\uc758 \ud615\ud0dc\ub85c \uc81c\uacf5\ub418\uba70, \uc608\ub97c \ub4e4\uc5b4 \uc5f0\uacb0\ub41c \uc774\ud130\ub808\uc774\ud130\uac00 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">\u00a0\u00a0\u00a0\u00a0var q = SELECT * FROM b1;<\/pre>\n<p><span style=\"font-weight: 400;\">\ubc18\ubcf5\uc790\ub97c \uc124\uba85\ud558\ub294 \ub370 \ub9ce\uc740 \uc2dc\uac04\uc744 \ud560\uc560\ud558\uc9c0 \uc54a\uc73c\ubbc0\ub85c \uc5ec\uae30\uc11c\ub294 \uae30\ubcf8 \uc0ac\ud56d\ub9cc \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\ubc18\ubcf5\uc790\uc5d0\uc11c \ub2e4\uc74c \uac12\uc744 \uac00\uc838\uc62c \uc218 \uc788\uc2b5\ub2c8\ub2e4. <\/span><span style=\"font-weight: 400;\">next()<\/span><span style=\"font-weight: 400;\"> \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\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;\">\uc644\ub8cc<\/span><span style=\"font-weight: 400;\"> \uc18d\uc131\uc740 \ub354 \uc774\uc0c1 \uac00\uc838\uc62c \ubb38\uc11c\uac00 \uc5c6\ub294 \uacbd\uc6b0 \ucc38\uc785\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\uc774\ud130\ub808\uc774\ud130\uc758 <\/span><em><span style=\"font-weight: 400;\">next()<\/span><\/em><span style=\"font-weight: 400;\"> \uadf8\ub9ac\uace0 <\/span><em><span style=\"font-weight: 400;\">\uc644\ub8cc<\/span><\/em><span style=\"font-weight: 400;\"> \uba64\ubc84\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubaa8\ub4e0 \ubb38\uc11c\ub97c \uac00\uc838\uc624\ub294 \ub3d9\uc548 \ub8e8\ud504\uc5d0\uc11c \ub354 \uc77d\uae30 \uc26c\uc6b4 \uad6c\uc870\ub294 <\/span><em><span style=\"font-weight: 400;\">for..of<\/span><\/em><span style=\"font-weight: 400;\"> \ubb38 \ud578\ub4e4 \uc790\uccb4\uc5d0 \ub300\ud55c \ub8e8\ud504\uc785\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\ubaa8\ub4e0 \uac12\uc744 \uac80\uc0c9\ud560 \ud544\uc694\ub294 \uc5c6\uc2b5\ub2c8\ub2e4. \uc5b8\uc81c\ub4e0\uc9c0 \ubb38\uc744 \uc0ad\uc81c\ud558\ub824\uba74 \ubb38\uc758 <\/span><em><span style=\"font-weight: 400;\">close()<\/span><\/em><span style=\"font-weight: 400;\"> \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc9c0\ub9cc, \ub098\uc911\uc5d0 \uc0b4\ud3b4\ubcf4\uaca0\uc9c0\ub9cc \uc774 \uc791\uc5c5\uc744 \uc804\ud600 \uc218\ud589\ud560 \ud544\uc694\ub294 \uc5c6\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\ubaa8\ub4e0 \uac83\uc744 \uc885\ud569\ud574 \ubcf4\uc138\uc694:<\/span><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13636 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/08\/image_2022-08-04_152817169.png\" alt=\"Basics of iterators in N1QL\/JavaScript and Couchbase\" width=\"655\" height=\"215\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/image_2022-08-04_152817169.png 655w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/image_2022-08-04_152817169-300x98.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/image_2022-08-04_152817169-20x7.png 20w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><br \/>\n<span style=\"font-weight: 400;\">\ubc0f \ud574\ub2f9 \ud568\uc218:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">CREATE FUNCTION doSelect() LANGUAGE JAVASCRIPT AS \"doSelect\" AT \"udfblog\";<\/pre>\n<p><span style=\"font-weight: 400;\">\uc774 \uc608\uc81c\uc5d0\uc11c\ub294 \ubc30\uc5f4 \uc774\ub984\uc774 <\/span><em><span style=\"font-weight: 400;\">res<\/span><\/em><span style=\"font-weight: 400;\"> \uc5d0\uc11c \uc5bb\uc740 \ubb38\uc11c\ub97c \ucd95\uc801\ud569\ub2c8\ub2e4. <\/span><span style=\"font-weight: 400;\"><em>b1<\/em> <\/span><span style=\"font-weight: 400;\">\ubc18\ubcf5\uae30\ub97c \ud1b5\ud574 <\/span><em><span style=\"font-weight: 400;\">q<\/span><\/em><span style=\"font-weight: 400;\">\ub97c \ud074\ub9ad\ud55c \ub2e4\uc74c \ubc1c\uc2e0\uc790\uc5d0\uac8c \ubc18\ud658\ud558\ub294 \ub370 \uc0ac\uc6a9\ub429\ub2c8\ub2e4.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">\uba87 \uac00\uc9c0 \ucc38\uace0 \uc0ac\ud56d<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">\uc77c\ubc18\uc801\uc73c\ub85c \ucffc\ub9ac \uac12\uc774 \uc218\uc2e0\ub418\uba74 <\/span><span style=\"font-weight: 400;\">\uc5d0 \ub300\ud55c<\/span><span style=\"font-weight: 400;\"> \ub8e8\ud504\uac00 \uc77c\uc2dc\uc801\uc778 \uba54\ubaa8\ub9ac \uc0ac\uc6a9\ub7c9\uc5d0 \uc601\ud5a5\uc744 \ubbf8\uce58\ubbc0\ub85c \ubc30\uc5f4\uc5d0 \ucd95\uc801\ud558\ub294 \ub300\uc2e0\uc5d0 \uc0ac\uc6a9\ud574\uc57c \ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ubc18\ub300\ub85c \ud568\uc218\uc5d0\uc11c \ubc30\uc5f4 \uac12\uc744 \ubc18\ud658\ud558\uba74 \uc608\ub97c \ub4e4\uc5b4 \ubb38\uc5d0\uc11c \ud568\uc218\ub97c \uc120\ud0dd\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">SELECT * FROM doSelect() AS funcDocs;<\/pre>\n<p><span style=\"font-weight: 400;\">\uc774\ub294 \uad00\uacc4\ud615 \uc138\uacc4\uc5d0\uc11c \uc811\ud588\ub358 \ud14c\uc774\ube14 \ud568\uc218\ub098 \uceec\ub809\uc158 \ud30c\uc0dd \ud14c\uc774\ube14\uc744 \uc0ac\uc6a9\ud560 \ub54c\uc640 \ub9e4\uc6b0 \uc720\uc0ac\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">N1QL \uc138\uacc4\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc54c\ub824\uc838 \uc788\uc2b5\ub2c8\ub2e4. <\/span><i><span style=\"font-weight: 400;\">\ud45c\ud604\uc2dd \uc2a4\uce94<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ubb3c\ub860 \ud568\uc218\uac00 \uc218\ud589\ud558\uace0\uc790 \ud558\ub294 \ubaa8\ub4e0 \uc791\uc5c5\uc774<\/span><i><span style=\"font-weight: 400;\"> \ud0a4 \uc2a4\ud398\uc774\uc2a4<\/span><\/i><span style=\"font-weight: 400;\"> \ucd94\uac00 \ub85c\uc9c1 \uc5c6\uc774 \uc778\ub77c\uc778 \ud568\uc218\ub97c \uc791\uc131\ud558\ub294 \uac83\uc774 \ub354 \ub098\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">\ub2e4\uc2dc \ubc18\ubcf5\uae30\ub85c \ub3cc\uc544\uac00\uc790!<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">\uac12 \ucc98\ub9ac\uac00 \ub05d\ub098\uba74 \ubc18\ubcf5\uae30\ub294 \uc790\ub3d9\uc73c\ub85c \ub2eb\ud788\ubbc0\ub85c \uc0ac\uc6a9\uc790\uac00 \ud560 \uc77c\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774\ud130\ub808\uc774\ud130\uac00 \ubc30\uc218\ub418\uc9c0 \uc54a\uc740 \uacbd\uc6b0, \ud568\uc218\uac00 \ubc18\ud658\ub420 \ub54c\ub098 \ub098\uc911\uc5d0 \uc0b4\ud3b4\ubcfc \ub2e4\ub978 \uc0c1\ud669\uc5d0\uc11c\ub3c4 \uc790\ub3d9\uc73c\ub85c \ub2eb\ud788\uae30 \ub54c\ubb38\uc5d0 \ubc18\ub4dc\uc2dc \ub2eb\uc544\uc57c \ud558\ub294 \uac83\uc740 \uc544\ub2c8\uc9c0\ub9cc \ub2eb\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ub0b4\ubd80 <\/span><span style=\"font-weight: 400;\"><em>\uc5d0 \ub300\ud55c ...<\/em> ...<\/span><span style=\"font-weight: 400;\"> \ub8e8\ud504\uc5d0 \ub2e4\ub978 N1QL \ubb38\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\ub3c4 \uc644\ubcbd\ud558\uac8c \uc720\ud6a8\ud558\uba70, \uace0\ub824\ud574\uc57c \ud560 \uba87 \uac00\uc9c0 \uc0ac\ud56d\uc740 \uc774\ud6c4 \uc139\uc158\uc5d0\uc11c \uc124\uba85\ud569\ub2c8\ub2e4.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">\ucc98\ub9ac \uac12<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">\uc120\ud0dd\uc5d0 \uc758\ud574 \ubc18\ud658\ub41c \uac12\uc744 \uadf8\ub0e5 \ubc18\ud658\ud558\ub294 \uac83\uc774 \uc544\ub2c8\ub77c \uc0ac\uc6a9\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">function doSelect() {\r\n\u00a0\u00a0\u00a0\u00a0var q = SELECT * FROM b1 LIMIT 2;\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\u00a0let f1 = doc.f1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(f1);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">\ubb38\uc11c\uc5d0\uc11c \ud544\ub4dc\ub97c \ucd94\ucd9c\ud558\ub294 \uac83\uc77c \ubfd0 \ud2b9\ubcc4\ud788 \ubcf5\uc7a1\ud55c \uac83\uc740 \uc5c6\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774 \ud568\uc218\ub97c \uc2e4\ud589\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\uc740 \uacb0\uacfc\uac00 \ub098\uc635\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">[\r\n\u00a0\u00a0[\r\n\u00a0\u00a0\u00a0\u00a0null,\r\n\u00a0\u00a0\u00a0\u00a0null\r\n\u00a0\u00a0]\r\n]<\/pre>\n<p><span style=\"font-weight: 400;\">\uc65c \uadf8\ub7f4\uae4c\uc694? \ubc18\ud658\ub418\uc9c0 \uc54a\ub294 \uc774\uc720 <em>f1<\/em>?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc2e4\ud589\uc744 \ud1b5\ud574 \ub2f5\uc744 \ucd94\uce21\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:default decode:true\">SELECT * FROM b1 LIMIT 2<\/pre>\n<p><span style=\"font-weight: 400;\">\uadf8\ub9ac\uace0 UI\uc5d0\uc11c \ud655\uc778\ud569\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">[\r\n\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\"b1\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"f1\": 1\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0},\r\n\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\"b1\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"f1\": 2\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0}\r\n]<\/pre>\n<p><em><span style=\"font-weight: 400;\">f1<\/span><\/em><span style=\"font-weight: 400;\"> \uc758 \ud544\ub4dc\uc785\ub2c8\ub2e4. <\/span><em><span style=\"font-weight: 400;\">b1<\/span><\/em><span style=\"font-weight: 400;\">\uc120\ud0dd\ud55c \ubb38\uc11c\uac00 \uc544\ub2c8\ub77c!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc5b4\ub5a4 \uac83\uc774\ub4e0 \uc6d0\ud558\ub294 \ub300\ub85c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doSelect() {\r\n\u00a0\u00a0\u00a0\u00a0var q = SELECT * FROM b1 LIMIT 2;\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\u00a0let f1 = doc.b1.f1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(f1);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<pre class=\"lang:js decode:true\">function doSelect() {\r\n\u00a0\u00a0\u00a0\u00a0var q = SELECT raw b1 FROM b1 LIMIT 2;\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\u00a0let f1 = doc.f1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(f1);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}\r\n\r\nfunction doSelect() {\r\n\u00a0\u00a0\u00a0\u00a0var q = SELECT f1 FROM b1 LIMIT 2;\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\u00a0let f1 = doc.f1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(f1);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #343e47; font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 50px;\">DML \ubb38<\/span><\/h2>\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 doCopy() {\r\n\u00a0\u00a0\u00a0\u00a0var q1 = INSERT INTO b1 (KEY UUID(), VALUE v) SELECT b1 AS v FROM b1;\r\n\u00a0\u00a0\u00a0\u00a0var q2 = DELETE FROM b1 WHERE LENGTH(meta().id) = 2;\r\n}<\/pre>\n<pre class=\"lang:default decode:true\">CREATE FUNCTION doCopy() LANGUAGE JAVASCRIPT AS \"doCopy\" AT \"udfblog\"<\/pre>\n<p><span style=\"font-weight: 400;\">\uc774 \uae30\ub2a5\uc740 \ub2e4\uc74c\uc5d0 \uc0c8 \ubb38\uc11c\ub97c \ub9cc\ub4ed\ub2c8\ub2e4. <em>b1<\/em> \uae30\uc874 \ubb38\uc11c\uc5d0\uc11c \ubcf5\uc0ac\ud558\uace0 \uc774\uc804 \ubb38\uc11c\ub97c \uc81c\uac70\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc0ac\uc2e4 <\/span><em><span style=\"font-weight: 400;\">q1<\/span><\/em><span style=\"font-weight: 400;\"> \uadf8\ub9ac\uace0 <\/span><em><span style=\"font-weight: 400;\">q2<\/span><\/em><span style=\"font-weight: 400;\"> \ubb38\uc774 \uac12\uc744 \ubc18\ud658\ud558\uc9c0 \uc54a\ub294\ub2e4\uace0 \ud574\ub3c4 \ud06c\uac8c \ub180\ub784 \uc77c\uc740 \uc544\ub2d9\ub2c8\ub2e4: \ub098\uc911\uc5d0 \uc0b4\ud3b4\ubcf4\uaca0\uc9c0\ub9cc DML \ubb38\uc740 \uac12\uc744 \ubc18\ud658\ud560 \uc218 \uc788\uace0, \ub354 \ub098\uc05c \uac83\uc740 \ud2b8\ub79c\uc2a4\ud30c\uc77c\ub7ec\uac00 \ud56d\uc0c1 \uac12\uc774 \ubc18\ud658\ub418\ub294\uc9c0 \uc5ec\ubd80\ub97c \ud655\uc778\ud560 \uc218 \uc5c6\uae30 \ub54c\ubb38\uc5d0 <em>N1QL()<\/em> \ud568\uc218\ub294 \ud56d\uc0c1 \ubc18\ubcf5\uc790\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774\uac83\uc774 \uc758\ubbf8\ud558\ub294 \ubc14\ub294 \uc77c\ub2e8 <em>N1QL()<\/em> \ud638\ucd9c\uc774 \ubc18\ud658\ub418\uba74 N1QL \ubb38\uc774 \ubc31\uadf8\ub77c\uc6b4\ub4dc\uc5d0\uc11c \ube44\ub3d9\uae30\uc801\uc73c\ub85c \uc2e4\ud589\ub420 \uc218 \uc788\uc73c\ubbc0\ub85c JavaScript \ud568\uc218\ub294 \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\uae30 \uc804\uc5d0 \ub2e4\ub978 \ucf54\ub4dc\ub97c \uc790\uc720\ub86d\uac8c \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uadf8\ub9ac\uace0 <em>jsevaluator<\/em> \ub294 \uac12\uc744 \ubc18\ud658\ud558\uc9c0 \uc54a\ub294 \ubb38\uc774 \uc989\uc2dc \uc5f0\uc18d\uc801\uc73c\ub85c \uc2e4\ud589\ub418\ub3c4\ub85d \uac15\uc81c\ud568\uc73c\ub85c\uc368 \ub3d9\uc791\uc758 \ubaa8\ud638\uc131\uc744 \uc81c\uac70\ud569\ub2c8\ub2e4. \uc989, \ub2e4\uc74c \ubb38\uc774 \uc2dc\uc791\ub418\uae30 \uc804\uc5d0 \uac01 DML \ubb38\uc774 \uc644\ub8cc\ub420 \ub54c\uae4c\uc9c0 \uae30\ub2e4\ub9bd\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ubc18\ubcf5\uae30\ub97c \ub2eb\uc744 \ud544\uc694\ub3c4 \uc5c6\uace0 \ubc18\ubcf5\uae30\uc5d0 \ub300\ud55c \uc791\uc5c5\ub3c4 \ud544\uc694\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uc774\ub294 \uc6b0\ub9ac\uac00 \ubcf8\ub2a5\uc801\uc73c\ub85c \uae30\ub300\ud558\ub294 \ud589\ub3d9\uacfc \uc77c\uce58\ud569\ub2c8\ub2e4. \uae30\uc874 \ubb38\uc11c\ub97c \uc0ad\uc81c\ud558\uae30 \uc804\uc5d0 \uae30\uc874 \ubb38\uc11c\uc758 \uc0ac\ubcf8 \uc0bd\uc785\uc744 \uc644\ub8cc\ud558\uace0 \uc2f6\uac70\ub098 \uc6d0\ubcf8 \ubb38\uc11c\uc758 \uc0ac\ubcf8\uc744 \ubaa8\ub450 \ub9cc\ub4e4\uc9c0 \uc54a\uc744 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4!<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">\uac12\uc744 \ubc18\ud658\ud558\ub294 DML \ubb38<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\uc544\ub798 \ud568\uc218\uc5d0\uc11c\uc640 \uac19\uc774 N1QL DML \ubb38\uc744 \ub9cc\ub4e4\uc5b4 \uac12\uc744 \ubc18\ud658\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"lang:js decode:true\">function doCopy() {\r\n\u00a0\u00a0\u00a0\u00a0var q1 = INSERT INTO b1 (KEY UUID(), VALUE v) SELECT b1 AS v FROM b1 RETURNING meta().id, b1;\r\n\u00a0\u00a0\u00a0\u00a0var res = []\r\n\u00a0\u00a0\u00a0\u00a0for (const doc of q1) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0res.push(doc);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0var q2 = DELETE FROM b1 WHERE LENGTH(meta().id) = 2;\r\n\u00a0\u00a0\u00a0\u00a0return res;\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">\ubc18\ud658\ub41c \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac70\uc758 \ub3d9\uc77c\ud55c \ubc29\uc2dd\uc73c\ub85c \ucc98\ub9ac\ub429\ub2c8\ub2e4. <em>\uc120\ud0dd<\/em> \ubb38\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uacb0\uacfc\ub97c \ubc18\ud658\ud558\uc9c0 \uc54a\ub294 DML \ubb38\uacfc \uac00\uc7a5 \ud070 \ucc28\uc774\uc810\uc740 \uacb0\uacfc\uac00 \ubc18\ud658\ub418\uc9c0 \uc54a\uc73c\uba74 \ubb38\uc774 \ubc18\ud658\ub418\ub294 \uc989\uc2dc \ubaa8\ub4e0 \ubcc0\uacbd \uc0ac\ud56d\uc774 \ub514\uc2a4\ud06c\uc5d0 \uc800\uc7a5\ub418\uc9c0\ub9cc, \uacb0\uacfc\uac00 \ubc18\ud658\ub418\uba74 \ubc18\ubcf5\uc790\ub85c\ubd80\ud130 \uac01 \uac1c\ubcc4 \ubb38\uc11c\uac00 \uc218\uc9d1\ub418\uba74\uc11c \ubb38\uc774 \uc9c4\ud589\ub418\ubbc0\ub85c \ubaa8\ub4e0 \ubcc0\uacbd \uc0ac\ud56d\uc5d0 \ub300\ud574 \ubc18\ud658\ub41c \uac12\uc744 \ubaa8\ub450 \ucc98\ub9ac\ud574\uc57c \ub514\uc2a4\ud06c\uc5d0 \uc800\uc7a5\ub41c\ub2e4\ub294 \uc810\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\ub2e4\uc2dc \ub9d0\ud558\uc9c0\ub9cc, \uc774 \ubb38\uc740 \ube44\ub3d9\uae30\uc801\uc73c\ub85c \uc2e4\ud589\ub418\ubbc0\ub85c \uac01 \uac1c\ubcc4 \uacb0\uacfc\ub97c \uc218\uc9d1\ud560 \ub54c \uc774\uac83\uc774 \ub514\uc2a4\ud06c\uc5d0 \ub9c8\uc9c0\ub9c9\uc73c\ub85c \uc218\uc815\ub41c \uacb0\uacfc\ub77c\uace0 \uac00\uc815\ud574\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4. \uc774\ubbf8 \ub354 \ub9ce\uc740 \uc218\uc815\uc774 \uc774\ub8e8\uc5b4\uc84c\uc744 \uc218 \uc788\uc73c\uba70 \uad00\ub828 \uacb0\uacfc\uac00 \uc218\uc9d1\ub418\uae30\ub97c \uae30\ub2e4\ub9ac\uba70 \ub300\uae30 \uc911\uc77c \ubfd0\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\uacb0\uacfc\ub97c \ubc18\ud658\ud558\uc9c0 \uc54a\ub294 DML \ubb38\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c \uacb0\uacfc\ub97c \ubc18\ud658\ud558\ub294 \ubb38\uc740 \uc21c\ucc28\uc801\uc73c\ub85c \uc2e4\ud589\ub418\ubbc0\ub85c \ub2e4\uc74c \ubb38\uc744 \uc2dc\uc791\ud560 \ub54c\uae4c\uc9c0 \ubc18\ubcf5\uae30\uc5d0 \ub300\uae30 \uc911\uc778 \ubaa8\ub4e0 \uacb0\uacfc\ub97c \ucc98\ub9ac\ud558\uc9c0 \uc54a\uc73c\uba74 jsevaluator\uac00 \ucc98\ub9ac\ub418\uc9c0 \uc54a\uc740 \uac12\uc744 \ubaa8\ub450 \ubc84\ub9ac\uace0 \ud604\uc7ac \ubb38\uc744 \uc644\ub8cc\ud569\ub2c8\ub2e4.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">\uacb0\ub860<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">N1QL\uc744 \ud1b5\ud55c \ubb38\uc11c \ucc98\ub9ac\uc640 \ub370\uc774\ud130 \uc870\uc791 \uc2e4\ud589\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><strong>\ub2e4\uc74c\uc73c\ub85c \uc624\ub958\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>This earlier blog goes through the basics of executing N1QL statements inside JavaScript functions. We now move onto\u2026 Iterators\/Processing values So far we have purposely avoided statements that return data, and returning data from the function. This is where we [&hellip;]<\/p>","protected":false},"author":1782,"featured_media":13637,"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":[2133,1543,8911],"ppma_author":[8924],"class_list":["post-13635","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-javascript","category-n1ql-query","tag-functions","tag-javascript","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 3: Iterating over Documents and DML - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Learn the basics of iterators in N1QL\/Javascript and Couchbase, the corresponding function, processing documents through N1QL and executing data manipulation.\" \/>\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-3\/\" \/>\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 3: Iterating over Documents and DML\" \/>\n<meta property=\"og:description\" content=\"Learn the basics of iterators in N1QL\/Javascript and Couchbase, the corresponding function, processing documents through N1QL and executing data manipulation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-3\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-04T23:02:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T00:20:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1707\" \/>\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=\"6\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-3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/\"},\"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 3: Iterating over Documents and DML\",\"datePublished\":\"2022-08-04T23:02:15+00:00\",\"dateModified\":\"2025-06-14T00:20:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/\"},\"wordCount\":949,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg\",\"keywords\":[\"functions\",\"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\/from-n1ql-to-javascript-and-back-part-3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/\",\"name\":\"From N1QL to JavaScript and Back - Part 3: Iterating over Documents and DML - 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-3\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg\",\"datePublished\":\"2022-08-04T23:02:15+00:00\",\"dateModified\":\"2025-06-14T00:20:44+00:00\",\"description\":\"Learn the basics of iterators in N1QL\/Javascript and Couchbase, the corresponding function, processing documents through N1QL and executing data manipulation.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg\",\"width\":2560,\"height\":1707,\"caption\":\"From N1QL to Javascript and back - Part 3: iterating over documents and DML\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#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 3: Iterating over Documents and DML\"}]},{\"@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 3: Iterating over Documents and DML - The Couchbase Blog","description":"N1QL\/Javascript \ubc0f Couchbase\uc758 \ubc18\ubcf5\uc790, \ud574\ub2f9 \ud568\uc218, N1QL\uc744 \ud1b5\ud55c \ubb38\uc11c \ucc98\ub9ac \ubc0f \ub370\uc774\ud130 \uc870\uc791 \uc2e4\ud589\uc5d0 \ub300\ud55c \uae30\ubcf8 \uc0ac\ud56d\uc744 \ud559\uc2b5\ud569\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-3\/","og_locale":"ko_KR","og_type":"article","og_title":"From N1QL to JavaScript and Back - Part 3: Iterating over Documents and DML","og_description":"Learn the basics of iterators in N1QL\/Javascript and Couchbase, the corresponding function, processing documents through N1QL and executing data manipulation.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/from-n1ql-to-javascript-and-back-part-3\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-08-04T23:02:15+00:00","article_modified_time":"2025-06-14T00:20:44+00:00","og_image":[{"width":2560,"height":1707,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.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":"6\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/"},"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 3: Iterating over Documents and DML","datePublished":"2022-08-04T23:02:15+00:00","dateModified":"2025-06-14T00:20:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/"},"wordCount":949,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg","keywords":["functions","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\/from-n1ql-to-javascript-and-back-part-3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/","url":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/","name":"From N1QL to JavaScript and Back - Part 3: Iterating over Documents and DML - 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-3\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg","datePublished":"2022-08-04T23:02:15+00:00","dateModified":"2025-06-14T00:20:44+00:00","description":"N1QL\/Javascript \ubc0f Couchbase\uc758 \ubc18\ubcf5\uc790, \ud574\ub2f9 \ud568\uc218, N1QL\uc744 \ud1b5\ud55c \ubb38\uc11c \ucc98\ub9ac \ubc0f \ub370\uc774\ud130 \uc870\uc791 \uc2e4\ud589\uc5d0 \ub300\ud55c \uae30\ubcf8 \uc0ac\ud56d\uc744 \ud559\uc2b5\ud569\ub2c8\ub2e4.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/08\/n1ql-javascript-iterators-scaled.jpg","width":2560,"height":1707,"caption":"From N1QL to Javascript and back - Part 3: iterating over documents and DML"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/from-n1ql-to-javascript-and-back-part-3\/#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 3: Iterating over Documents and DML"}]},{"@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\/13635","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=13635"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/13635\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/13637"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=13635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=13635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=13635"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=13635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}