{"id":806,"date":"2021-12-16T04:53:25","date_gmt":"2021-12-16T04:53:25","guid":{"rendered":"https:\/\/scrutineer.co.kr\/wordpress\/?p=806"},"modified":"2021-12-16T05:40:42","modified_gmt":"2021-12-16T05:40:42","slug":"%eb%aa%bd%ea%b3%a0-%eb%94%94%eb%b9%84-%ec%9d%b8-%ec%95%a1%ec%85%98-7%ec%9e%a5-2","status":"publish","type":"post","link":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/2021\/12\/16\/%eb%aa%bd%ea%b3%a0-%eb%94%94%eb%b9%84-%ec%9d%b8-%ec%95%a1%ec%85%98-7%ec%9e%a5-2\/","title":{"rendered":"\ubabd\uace0 \ub514\ube44 \uc778 \uc561\uc158 7\uc7a5-2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\" style=\"font-size:30px\">MongoDB \uc5c5\ub370\uc774\ud2b8\uc640 \uc0ad\uc81c<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">[<strong>\uc5c5\ub370\uc774\ud2b8 \ud0c0\uc785\uacfc \uc635\uc158]<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">MongoDB \uc5c5\ub370\uc774\ud2b8 \ubc29\uc2dd<br>&#8211; \ud0c0\uae43\ubc29\uc2dd<br>&#8211; \ub300\uce58\ubc29\uc2dd<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">db.products.update_one({}, {name: \"Pitchfork\", $addToSet: {tags: 'cheap'}})\n\/\/\ub3c4\ud050\uba3c\ud2b8 \uc774\ub984\uc744 \ubc14\uafb8\ub824\ub294 \ubaa9\uc801\uc774\uba74 $set \uc5f0\uc0b0\uc790 \uc0ac\uc6a9\ndb.products.update_one({},\n{$set: {name: \"Pitchfork\"}, $addToSet: {tags: 'cheap'}})<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\ub2e4\uc911 \ub3c4\ud050\uba3c\ud2b8 \uc5c5\ub370\uc774\ud2b8<\/strong><br> &#8211; \uae30\ubcf8\uc801\uc73c\ub85c \ucffc\ub9ac \uc140\ub809\ud130\uc640 \uc77c\uce58\ud558\ub294 \uccab \ubc88\uc9f8 \ub3c4\ud050\uba3c\ud2b8\ub9cc\uc744 \uc5c5\ub370\uc774\ud2b8 \ud568 =&gt; \uc5ec\ub7ec \uac1c\ub97c \ud558\ub824\uba74 \ub2e4\uc911 \uc5c5\ub370\uc774\ud2b8 \uc0ac\uc6a9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/ \ubaa8\ub4e0 \ub3c4\ud050\uba3c\ud2b8\uc5d0 cheap \ud0dc\uadf8 \ucd94\uac00\ud574\ubcf4\uc790.\ndb.products.update({}, {$addToSet: {tags: 'cheap'}}, {multi: true}) \/\/ multi : true \ub9e4\uac1c\ubcc0\uc218 \uac12 \ucd94\uac00\n\/\/TODO : \uc5c5\ub370\uc774\ud2b8\ub294 \uc6d0\uc790\uc801\uc73c\ub85c \uc791\ub3d9\ub418\ubbc0\ub85c \uc2e4\ud328\uc5d0 \ub300\ud55c \ucc98\ub9ac\ub3c4 \uac19\uc774 \ub418\uc5b4\uc57c\ud55c\ub2e4.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\uc5c5\uc11c\ud2b8<\/strong><br>&#8211; \uc544\uc774\ud15c\uc774 \uc5c6\uc744 \uacbd\uc6b0 \uc0c8\ub85c \ucd94\uac00\ud558\uace0 \uc774\ubbf8 \uc788\ub2e4\uba74 \uc5c5\ub370\uc774\ud2b8 \ud558\ub294\uac83 (=merge \uc640 \uac19\uc740..)<br> \uc5c5\uc11c\ud2b8\ub294 \ub300\uce58 \ubc29\uc2dd\uc758 \uc5c5\ub370\uc774\ud2b8\uc5d0\uc11c\ub294 \uc218\ud589\ub420 \uc218 \uc5c6\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">db.products.update({slug: 'hammer'}, \n                          {$addToSet: {tags: 'cheap'}}, {upsert: true}) \/\/ upsert : true \ub9e4\uac1c\ubcc0\uc218 \uac12 \ucd94\uac00<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>[\uc5c5\ub370\uc774\ud2b8 \uc5f0\uc0b0\uc790]<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud45c\uc900\uc801\uc778 \uc5c5\ub370\uc774\ud2b8 \uc5f0\uc0b0\uc790<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> $inc : \uc218\uce58 \uc99d\uac00 \ub610\ub294 \uac10\uc18c\ud560 \ub54c \uc0ac\uc6a9, \uc218\uc758 \ud0c0\uc785\uc774 \ubcc0\uacbd\ub418\uc9c0 \uc54a\ub294 \ud55c \ub514\uc2a4\ud06c\uc5d0 \ud574\ub2f9 \ubd80\ubd84\ub9cc \uc801\uc6a9\uc774 \ub418\uc5b4 \uc9c0\uc815\ub41c \uac12\ub9cc \uc601\ud5a5\uc744 \ubc1b\uc74c.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">db.products.update({slug: \"shovel\"}, {$inc: {review_count: 1}})\ndb.users.update({username: \"moe\"}, {$inc: {password_retries: -1}})\n\/\/\uc218\uce58\ub97c \ub354\ud558\uac70\ub098 \ube84 \ub54c\ndb.readings.update({_id: 324}, {$inc: {temp: 2.7435}})\n\/\/\uc544\uc774\ub514\uac00 324\uac00 \uc5c6\uc744 \uacbd\uc6b0 \uc0c8\ub85c \uc0dd\uc131\ndb.readings.update({_id: 324}, {$inc: {temp: 2.7435}}, {upsert: true})<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$set, $unset : $set &#8211; \ud2b9\uc815 \ud0a4\uc758 \uac12\uc744 \uc815\ud574\uc904 \ub54c, $unset &#8211; \ub3c4\ud050\uba3c\ud2b8\uc5d0 \ud574\ub2f9 \ud0a4 \uc0ad\uc81c<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/ \ud0a4\uc5d0 \ub300\ud55c \uac12\uc774 \uc774\ubbf8 \uc874\uc7ac\ud558\uba74 \uadf8 \uac12\uc744 \ub36e\uc5b4\uc4f0\uace0 \uadf8\ub807\uc9c0 \uc54a\uc744 \uacbd\uc6b0 \uc0c8\ub85c\uc6b4 \ud0a4 \uc0dd\uc131\ndb.readings.update({_id: 324}, {$set: {temp: 97.6}})\ndb.readings.update({_id: 325}, {$set: {temp: {f: 212, c: 100}}})\ndb.readings.update({_id: 326}, {$set: {temps: [97.6, 98.4, 99.1]}})\n\n\/\/ readings\ub77c\ub294 \uceec\ub809\uc158 \ub0b4\uc5d0 324 \uc544\uc774\ub514\uc758 temp \ud0a4 \uc0ad\uc81c\ndb.readings.update({_id: 324}, {$unset: {temp: 1}})\n\n{_id: 325, 'temp': {f: 212, c: 100}}\ndb.readings.update({_id: 325}, {$unset: {'temp.f': 1}}) \/\/ f(\ud654\uc528) \uc0ad\uc81c\n{_id: 326, temps: [97.6, 98.4, 99.1]}\ndb.readings.update({_id: 326}, {$pop: {temps: -1}}) \/\/0\ubc88\uc9f8 \ubc30\uc5f4 \uac12 \uc0ad\uc81c\n\n\/\/ $unset\uc758 \ubc30\uc5f4\ucc98\ub9ac\ub294 \uc0ad\uc81c\uac00 \uc544\ub2c8\ub77c null\ucc98\ub9ac\uac00 \ub428. \uc0ad\uc81c\ud558\uae30 \uc704\ud574\uc11c\ub294 $pull,  $pop \uc0ac\uc6a9\ndb.readings.update({_id: 325}, {$unset: {'temp.f': 1}})\ndb.readings.update({_id: 326}, {$unset: {'temps.0': 1}})<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$rename : \ud0a4\uc758 \uc774\ub984\uc744 \ubc14\uafc0 \ub54c \uc0ac\uc6a9<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">db.readings.update({_id: 324}, {$rename: {'temp': 'temperature'}})\ndb.readings.update({_id: 325}, {$rename: {'temp.f': 'temp.fahrenheit'}})<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$setOnInsert : \ub3c4\ud050\uba3c\ud2b8\uac00 \uc0c8 \uac83\uc774\uace0 \uc0bd\uc785\uc744 \uc218\ud589\ud560 \ub54c\ub9cc \ud544\ub4dc\ub97c \uc218\uc815\ud558\ub3c4\ub85d \uc9c0\uc815 (\uc5c5\uc11c\ud2b8 \uc911\uc5d0 \uad00\ub9ac\ud558\ub294 \ub370\uc774\ud130\ub97c \uc5c5\ub370\uc774\ud2b8 \ub418\uc9c0 \uc54a\ub3c4\ub85d)<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/ state \uac12\uc758 \ubcc0\ub3d9 \uc5c6\uc774 \uc7ac\uace0 \ud2b9\uc815 \ud56d\ubaa9\uc758 \uc218\ub7c9\uc744 \uc99d\uac00\ndb.products.update({slug: 'hammer'}, {\n    $inc: {\n              quantity: 1\n     },\n     $setOnInsert: {\n               state: 'AVAILABLE' \n      }\n}, {upsert: true})<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ubc30\uc5f4 \uc5c5\ub370\uc774\ud2b8 \uc5f0\uc0b0\uc790<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$push, $pushAll, $each : <br>$push &#8211; \ubc30\uc5f4\uc758 \uac12\uc744 \ucd94\uac00. \ubc30\uc5f4 \ub05d\uc5d0 \ub2e8\uc77c \uc694\uc18c \ucd94\uac00<br>$pushAll &#8211; \uc5ec\ub7ec \uac1c \uac12\uc744 \ubc30\uc5f4\uc5d0 \ucd94\uac00 (deprecated \uac00\ub2a5\uc131 \uc788\uc74c)<br>$each &#8211; $push\uc640 \uac19\uc774 \uc5ec\ub7ec \uac1c \ucd94\uac00\ud560 \ub54c \uc0ac\uc6a9<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/shovel \uc0c1\ud488\uc5d0 \uc0c8\ub85c\uc6b4 \ud0dc\uadf8 \ucd94\uac00\ndb.products.update({slug: 'shovel'}, {$push: {tags: 'tools'}})\n\/\/\ud0dc\uadf8\ub97c \uc5ec\ub7ec \uac1c \ucd94\uac00\ndb.products.update({slug: 'shovel'},\n         {$push: {tags: {$each: ['tools', 'dirt', 'garden']}}})\n\/\/\ud0dc\uadf8\ub97c \uc5ec\ub7ec \uac1c \ucd94\uac00 \ndb.products.update({slug: 'shovel'},\n         {$pushAll: {'tags': ['tools', 'dirt', 'garden']}})<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$slice : \uac12\uc744 \ubc30\uc5f4\ub85c \ub123\uace0 \ub108\ubb34 \ud06c\uac8c \ub298\ub9ac\uc9c0 \uc54a\uc744 \ub54c \uc0ac\uc6a9<br>$push \uc640 $each \uc5f0\uc0b0\uc790\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud558\uba70 \uacb0\uacfc \ubc30\uc5f4\uc744 \ud2b9\uc815 \ud06c\uae30\ub85c \uc798\ub77c \uc774\uc804 \ubc84\uc804\uc744 \uba3c\uc800 \uc81c\uac70\ud560 \uc218 \uc788\ub2e4.<br>\uc778\uc218\ub294 0\ubcf4\ub2e4 \uc791\uac70\ub098 \uac19\uc544\uc57c \ud55c\ub2e4.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">{\n    _id: 326,\n    temps: [92, 93, 94]\n}\n\n\/\/ \uc704 \ub3c4\ud050\uba3c\ud2b8 \uc5c5\ub370\uc774\ud2b8\ndb.temps.update({_id: 326}, {\n     $push: {\n          temps: {\n               $each: [95, 96],\n               $slice: -4 \n          }\n      }\n})\n\/\/ \uacb0\uacfc \uac12\n\/\/ \uac12\uc744 \ubc30\uc5f4\ub85c \ubc00\uc5b4\ub123\uc740 \ud6c4 \uac12\uc774 \ub124 \uac1c\ub9cc \ub0a8\uc744 \ub54c\uae4c\uc9c0 \uc81c\uac70\r\n\/\/ -1 \uc77c\ub54c\ub294 96, 0\uc77c\ub54c\ub294 [], 4\uc77c \ub54c\ub294 [92,93,94,95]\r\n{\n   _id: 326,\n   temps: [93, 94, 95, 96]\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$sort : $push, $slice, $each \uc5f0\uc0b0\uc790\uc640 \uc815\ub82c<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">{\r\n    _id: 300,\r\n    temps: [\r\n           { day: 6, temp: 90 },\r\n           { day: 5, temp: 95 }\r\n     ]\r\n}\n\/\/day \uae30\uc900\uc73c\ub85c \uc815\ub82c\ud55c \ud6c4 \ubc30\uc5f4 \ucd94\uac00\ndb.temps.update({_id: 300}, {\r\n      $push: {\r\n           temps: {\r\n               $each: [\r\n                     { day: 7, temp: 92 }\r\n                ],\r\n                $slice: -2,\r\n                $sort: {\r\n                      day: 1\r\n                 }\r\n            }\r\n      }\r\n})\n\n\/\/\uacb0\uacfc \uac12\n{\r\n      _id: 300,\r\n      temps: [\r\n         { day: 6, temp: 90 },\r\n         { day: 7, temp: 92 }\r\n      ]\r\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$addToSet, $each :<br>$addToSet &#8211; \ubc30\uc5f4\uc5d0 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0\uc5d0\ub9cc \ucd94\uac00<br>$each\ub294 $addToSet \ubc0f $push \uc5f0\uc0b0\uc790\uc5d0\uc11c\ub9cc \uc0ac\uc6a9\ub420 \uc218 \uc788\ub2e4.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/shovel \uc0c1\ud488\uc5d0 tool\uc774\ub77c\ub294 \ud0dc\uadf8 \uac12\uc744 \uac00\uc9c0\uace0 \uc788\uc73c\uba74 \uc218\ud589\ud558\uc9c0 \uc54a\uc74c\ndb.products.update({slug: 'shovel'}, {$addToSet: {'tags': 'tools'}})\n\/\/$each\uc5d0 \uc9c0\uc815\ub41c \uac12 \uc911\uc5d0 tags\uc5d0 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub294 \uac12\ub9cc \ucd94\uac00\ndb.products.update({slug: 'shovel'},\r\n    {$addToSet: {tags: {$each: ['tools', 'dirt', 'steel']}}})<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$pop : \ubc30\uc5f4\uc5d0\uc11c \uc544\uc774\ud15c\uc744 \uc0ad\uc81c\ud558\ub294 \uac00\uc7a5 \uae30\ubcf8\uc801\uc778 \ubc29\ubc95 ($push\uc640 \ubc18\ub300)<br>\ub9c8\uc9c0\ub9c9\uc73c\ub85c \ucca8\uac00\ub41c \uc544\uc774\ud15c \uc0ad\uc81c. \uc0ad\uc81c\ub41c \uac12\uc744 \ubc18\ud658\ud558\uc9c0 \uc54a\uc74c<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/ ['tools', 'dirt', 'garden', 'steel'] -> ['tools', 'dirt', 'garden']\ndb.products.update({slug: 'shovel'}, {$pop: {'tags': 1}})\n\/\/ ['tools', 'dirt', 'garden'] -> ['dirt', 'garden']\ndb.products.update({slug: 'shovel'}, {$pop: {'tags': -1}})<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$bit : \uc5c5\ub370\uc774\ud2b8\uc0c1\uc5d0\uc11c \ube44\ud2b8\ub2e8\uc704 OR \uc5f0\uc0b0\uacfc AND \uc5f0\uc0b0\uc744 \ud558\uac8c \ud574\uc90c<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">{\r\n    _id: 16,\r\n    permissions: 4 \/\/r-- , \uc774\uc9c4\uc218 100\r\n}\n\n\/\/\ube44\ud2b8\ub2e8\uc704 OR \uc5f0\uc0b0\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc4f0\uae30 \uad8c\ud55c \ucd94\uac00\n\/\/number\uc5d0 double\uc744 \uc0ac\uc6a9\ud558\ubbc0\ub85c NumberInt() \uc0ac\uc6a9\ndb.permissions.update({_id: 16}, {$bit: {permissions: {or: NumberInt(2)}}})\n\n{\r\n   _id: 16,\r\n   permissions: 6 \/\/rw-, \uc774\uc9c4\uc218110\r\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>$pull, $pullAll : <br>$pull &#8211; \ubc30\uc5f4\uc5d0\uc11c \uc6d0\uc18c\uc758 \uc704\uce58 \ub300\uc2e0 \uac12\uc744 \uc9c0\uc815\ud574\uc11c \uc544\uc774\ud15c \uc0ad\uc81c<br>$pullAll &#8211; \uc5ec\ub7ec \uac1c\uc758 \uac12\uc744 \uc0ad\uc81c<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">db.products.update({slug: 'shovel'}, {$pull: {tags: 'dirt'}})\ndb.products.update({slug: 'shovel'},\r\n    {$pullAll: {'tags': ['dirt', 'garden']}})\n\n{_id: 326, temps: [97.6, 98.4, 100.5, 99.1, 101.2]}\n\/\/ 100\ubcf4\ub2e4 \ub192\uc740 \uc628\ub3c4 \uc0ad\uc81c\ndb.readings.update({_id: 326}, {$pull: {temps: {$gt: 100}}})\n\/\/\uacb0\uacfc \uac12\n{_id: 326, temps: [97.6, 98.4, 99.1]}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc704\uce58 \uc5c5\ub370\uc774\ud2b8<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">{\r\n    _id: ObjectId(\"6a5b1476238d3b4dd5000048\"),\r\n    line_items: [\n        {\r\n              _id: ObjectId(\"4c4b1476238d3b4dd5003981\"),\r\n              sku: \"9092\",\r\n              name: \"Extra Large Wheelbarrow\",\r\n              quantity: 1,\r\n              pricing: {\r\n                 retail: 5897,\r\n                 sale: 4897\r\n              }\r\n         },\r\n        {\r\n              _id: ObjectId(\"4c4b1476238d3b4dd5003982\"),\r\n              sku: \"10027\",\r\n              name: \"Rubberized Work Glove, Black\",\r\n              quantity: 2,\r\n              pricing: {\r\n                 retail: 1499,\r\n                 sale: 1299\r\n              }\r\n        }\r\n    ]\r\n}\n\n\/\/ SKU 10027\uc778 \uc8fc\ubb38 \uc544\uc774\ud15c\uc758 \uc218\ub7c9\uc744 5\ub85c \uc218\uc815\ud558\uae38 \uc6d0\ud560 \ub54c \nquery = {\r\n   _id: ObjectId(\"6a5b1476238d3b4dd5000048\"),\r\n   'line_items.sku': \"10027\"\r\n}\r\nupdate = {\r\n   $set: {\r\n       'line_items.$.quantity': 5 \/\/$\uac00 \uc704\uce58 \uc5f0\uc0b0\uc790\r\n   }\r\n}\r\ndb.orders.update(query, update)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>[findAndModify \uba85\ub839]<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">doc = db.orders.findAndModify({\r\n   query: {\r\n      user_id: ObjectId(\"4c4b1476238d3b4dd5000001\"),\r\n   },\r\n   update: {\r\n       $set: {\r\n          state: \"AUTHORIZING\"\r\n       }\r\n    }\r\n})<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>query : \ub3c4\ud050\uba3c\ud2b8 \ucffc\ub9ac \uc140\ub809\ud130\uc774\uace0 \ub514\ud3f4\ud2b8 \uac12\uc740 {}<\/li><li>update : \uc5c5\ub370\uc774\ud2b8\ud560 \ub0b4\uc6a9\uc744 \uc9c0\uc815\ud558\ub294 \ub3c4\ud050\uba3c\ud2b8\uc774\uace0 \ub514\ud3f4\ud2b8 \uac12\uc740 {}<\/li><li>remove : true\uba74 \uac1d\uccb4 \uc0ad\uc81c, \ub514\ud3f4\ud2b8 \uac12\uc740 false<\/li><li>new : true\uba74 \uc5c5\ub370\uc774\ud2b8 \uc218\ud589\ud55c \ud6c4 \uc5c5\ub370\uc774\ud2b8 \uc801\uc6a9\ub41c \ub3c4\ud050\uba3c\ud2b8 \ubc18\ud658, \ub514\ud3f4\ud2b8 \uac12\uc740 false<\/li><li>sort : \uc815\ub82c \ubc29\ud5a5\uc744 \uacb0\uc815\ud558\ub294 \ub3c4\ud050\uba3c\ud2b8, \uc77c\uce58\ud558\ub294 \ub3c4\ud050\uba3c\ud2b8 \uc911 \uc5b4\ub5a4 \uac83\uc744 \ucc98\ub9ac\ud574\uc57c\ud558\ub294\uc9c0 \uc815\ud558\ub294\ub370 \uc0ac\uc6a9\ub428, \ucd5c\uadfc \uc0dd\uc131\ub41c \ub3c4\ud050\uba3c\ud2b8 \ucc98\ub9ac \uc2dc {created_at:-1} \ud615\uc2dd\uc744 \uc0ac\uc6a9 \uac00\ub2a5<\/li><li>fields : \uc77c\ubd80\uc758 \ud544\ub4dc\ub9cc \ud544\uc694\ud558\ub2e4\uba74 \uc774 \uc635\uc158\uc73c\ub85c \ud544\uc694\ud55c \ud544\ub4dc \uc9c0\uc815.<\/li><li>upsert : true\uc774\uba74 findAndModify\ub97c \uc5c5\uc11c\ud2b8\ucc98\ub7fc \uc218\ud589. \uc0c8\ub85c \uc0dd\uc131\ud55c \ub3c4\ud050\uba3c\ud2b8 \ubc18\ud658 \uc2dc {new:ture} \uc0ac\uc6a9<\/li><\/ul>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>[\uc0ad\uc81c]<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/\ubaa8\ub4e0 \ub9ac\ubdf0 \uc0ad\uc81c\ndb.reviews.remove({})\n\/\/\ud2b9\uc815 \uc0ac\uc6a9\uc790\uac00 \uc791\uc131\ud55c \ub9ac\ubdf0 \uc0ad\uc81c\ndb.reviews.remove({user_id: ObjectId('4c4b1476238d3b4dd5000001')})<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>[\ub3d9\uc2dc\uc131, \uc6d0\uc790\uc131, \uace0\ub9bd]<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">[<strong>\uc5c5\ub370\uc774\ud2b8\uc131\ub2a5]<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB \uc5c5\ub370\uc774\ud2b8\uc640 \uc0ad\uc81c [\uc5c5\ub370\uc774\ud2b8 \ud0c0\uc785\uacfc \uc635\uc158] MongoDB \uc5c5\ub370\uc774\ud2b8 \ubc29\uc2dd&#8211; \ud0c0\uae43\ubc29\uc2dd&#8211; \ub300\uce58\ubc29\uc2dd \ub2e4\uc911 \ub3c4\ud050\uba3c\ud2b8 \uc5c5\ub370\uc774\ud2b8 &#8211; \uae30\ubcf8\uc801\uc73c\ub85c \ucffc\ub9ac \uc140\ub809\ud130\uc640 \uc77c\uce58\ud558\ub294 \uccab \ubc88\uc9f8 \ub3c4\ud050\uba3c\ud2b8\ub9cc\uc744 \uc5c5\ub370\uc774\ud2b8 \ud568 =&gt; \uc5ec\ub7ec \uac1c\ub97c \ud558\ub824\uba74 \ub2e4\uc911 \uc5c5\ub370\uc774\ud2b8 \uc0ac\uc6a9 \uc5c5\uc11c\ud2b8&#8211; \uc544\uc774\ud15c\uc774 \uc5c6\uc744 \uacbd\uc6b0 \uc0c8\ub85c \ucd94\uac00\ud558\uace0 \uc774\ubbf8 \uc788\ub2e4\uba74 \uc5c5\ub370\uc774\ud2b8 \ud558\ub294\uac83 (=merge \uc640 \uac19\uc740..) \uc5c5\uc11c\ud2b8\ub294 \ub300\uce58 \ubc29\uc2dd\uc758 \uc5c5\ub370\uc774\ud2b8\uc5d0\uc11c\ub294 \uc218\ud589\ub420 \uc218 \uc5c6\ub2e4. [\uc5c5\ub370\uc774\ud2b8 \uc5f0\uc0b0\uc790] \ud45c\uc900\uc801\uc778 \uc5c5\ub370\uc774\ud2b8 &#8230; <a title=\"\ubabd\uace0 \ub514\ube44 \uc778 \uc561\uc158 7\uc7a5-2\" class=\"read-more\" href=\"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/2021\/12\/16\/%eb%aa%bd%ea%b3%a0-%eb%94%94%eb%b9%84-%ec%9d%b8-%ec%95%a1%ec%85%98-7%ec%9e%a5-2\/\" aria-label=\"Read more about \ubabd\uace0 \ub514\ube44 \uc778 \uc561\uc158 7\uc7a5-2\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-806","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=806"}],"version-history":[{"count":4,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/806\/revisions"}],"predecessor-version":[{"id":813,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/806\/revisions\/813"}],"wp:attachment":[{"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scrutineer.co.kr\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}