{"id":247411,"date":"2024-01-02T21:53:25","date_gmt":"2024-01-02T13:53:25","guid":{"rendered":"https:\/\/www.idc.net\/help\/247411\/"},"modified":"2024-01-02T21:53:25","modified_gmt":"2024-01-02T13:53:25","slug":"mongodb-%e6%9c%af%e8%af%ad-%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/247411\/","title":{"rendered":"MongoDB \u672f\u8bed &#8211; \u6a21\u5f0f"},"content":{"rendered":"<p><title>MongoDB \u672f\u8bed - \u6a21\u5f0f<\/title><\/p>\n<h1 id=\"mongodb-%e6%9c%af%e8%af%ad-%e6%a8%a1%e5%bc%8f-NPBWOEJYKn\"> MongoDB \u672f\u8bed - \u6a21\u5f0f <\/h1>\n<h2 id=\"%e4%bb%80%e4%b9%88%e6%98%af-mongodb-%e6%a8%a1%e5%bc%8f%ef%bc%9f-NPBWOEJYKn\"> \u4ec0\u4e48\u662f MongoDB \u6a21\u5f0f\uff1f<\/h2>\n<p> \u5728 MongoDB \u4e2d\uff0c\u6a21\u5f0f\u662f\u6307\u96c6\u5408\u4e2d\u6587\u6863\u7684\u7ed3\u6784\u548c\u5b57\u6bb5\u7684\u89c4\u5b9a\u3002\u4e0e\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e0d\u540c\uff0cMongoDB \u662f\u4e00\u4e2a\u9762\u5411\u6587\u6863\u7684\u6570\u636e\u5e93\uff0c\u4e0d\u9700\u8981\u9884\u5148\u5b9a\u4e49\u8868\u7684\u7ed3\u6784\u3002\u8fd9\u610f\u5473\u7740\u6bcf\u4e2a\u6587\u6863\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u7ed3\u6784\uff0c\u4f46\u5728\u4e00\u4e2a\u96c6\u5408\u4e2d\u7684\u6587\u6863\u901a\u5e38\u5177\u6709\u76f8\u4f3c\u7684\u6a21\u5f0f\u3002<\/p>\n<h2 id=\"mongodb-%e6%a8%a1%e5%bc%8f%e7%9a%84%e7%89%b9%e7%82%b9-NPBWOEJYKn\"> MongoDB \u6a21\u5f0f\u7684\u7279\u70b9<\/h2>\n<p> MongoDB \u6a21\u5f0f\u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a<\/p>\n<ul>\n<li>\u7075\u6d3b\u6027\uff1aMongoDB \u7684\u6a21\u5f0f\u662f\u52a8\u6001\u7684\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u968f\u65f6\u66f4\u6539\u3002<\/li>\n<li>\u5d4c\u5957\u7ed3\u6784\uff1aMongoDB \u652f\u6301\u5d4c\u5957\u6587\u6863\u548c\u6570\u7ec4\uff0c\u53ef\u4ee5\u5728\u4e00\u4e2a\u6587\u6863\u4e2d\u5d4c\u5957\u5176\u4ed6\u6587\u6863\u6216\u6570\u7ec4\u3002<\/li>\n<li>\u65e0\u9700\u9884\u5b9a\u4e49\u5b57\u6bb5\uff1a\u4e0e\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e0d\u540c\uff0cMongoDB \u4e0d\u9700\u8981\u9884\u5148\u5b9a\u4e49\u5b57\u6bb5\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u52a8\u6001\u6dfb\u52a0\u5b57\u6bb5\u3002<\/li>\n<\/ul>\n<h2 id=\"mongodb-%e6%a8%a1%e5%bc%8f%e7%a4%ba%e4%be%8b-NPBWOEJYKn\"> MongoDB \u6a21\u5f0f\u793a\u4f8b<\/h2>\n<p> \u4e0b\u9762\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u4e00\u4e2a\u540d\u4e3a \"users\" \u7684\u96c6\u5408\u4e2d\u7684\u6587\u6863\u7684\u6a21\u5f0f\uff1a<\/p>\n<pre><code>\n{\n  \"_id\": ObjectId(\"5f7e1a8e8e9a7b6c4d3e2f1\"),\n  \"name\": \"John Doe\",\n  \"age\": 30,\n  \"email\": \"john.doe@example.com\",\n  \"address\": {\n    \"street\": \"123 Main St\",\n    \"city\": \"New York\",\n    \"state\": \"NY\",\n    \"zip\": \"10001\"\n  },\n  \"interests\": [\"reading\", \"music\", \"sports\"]\n}\n<\/code><\/pre>\n<p> \u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6bcf\u4e2a\u6587\u6863\u90fd\u6709\u4e00\u4e2a\u552f\u4e00\u7684 \"_id\" \u5b57\u6bb5\uff0c\u4ee5\u53ca \"name\"\u3001\"age\"\u3001\"email\"\u3001\"address\" \u548c \"interests\" \u7b49\u5b57\u6bb5\u3002\u5176\u4e2d\uff0c\"address\" \u662f\u4e00\u4e2a\u5d4c\u5957\u7684\u6587\u6863\uff0c\u5305\u542b\u4e86\u8857\u9053\u3001\u57ce\u5e02\u3001\u5dde\u548c\u90ae\u7f16\u7b49\u5b57\u6bb5\u3002\"interests\" \u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u5305\u542b\u4e86\u7528\u6237\u7684\u5174\u8da3\u7231\u597d\u3002<\/p>\n<h2 id=\"mongodb-%e6%a8%a1%e5%bc%8f%e8%ae%be%e8%ae%a1%e5%8e%9f%e5%88%99-NPBWOEJYKn\"> MongoDB \u6a21\u5f0f\u8bbe\u8ba1\u539f\u5219<\/h2>\n<p> \u5728\u8bbe\u8ba1 MongoDB \u6a21\u5f0f\u65f6\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u539f\u5219\uff1a<\/p>\n<ul>\n<li>\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u7684\u67e5\u8be2\u9700\u6c42\u6765\u8bbe\u8ba1\u6a21\u5f0f\u3002<\/li>\n<li>\u5c3d\u91cf\u907f\u514d\u9891\u7e41\u7684\u6a21\u5f0f\u66f4\u6539\uff0c\u4ee5\u63d0\u9ad8\u6027\u80fd\u3002<\/li>\n<li>\u4f7f\u7528\u5d4c\u5957\u7ed3\u6784\u6765\u51cf\u5c11\u591a\u4e2a\u96c6\u5408\u4e4b\u95f4\u7684\u5173\u8054\u67e5\u8be2\u3002<\/li>\n<li>\u6839\u636e\u6570\u636e\u7684\u8bbf\u95ee\u6a21\u5f0f\u6765\u9009\u62e9\u9002\u5f53\u7684\u7d22\u5f15\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%80%bb%e7%bb%93-NPBWOEJYKn\"> \u603b\u7ed3<\/h2>\n<p> MongoDB \u6a21\u5f0f\u662f\u6307\u96c6\u5408\u4e2d\u6587\u6863\u7684\u7ed3\u6784\u548c\u5b57\u6bb5\u7684\u89c4\u5b9a\u3002\u4e0e\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e0d\u540c\uff0cMongoDB \u7684\u6a21\u5f0f\u662f\u52a8\u6001\u7684\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u968f\u65f6\u66f4\u6539\u3002\u5b83\u652f\u6301\u5d4c\u5957\u7ed3\u6784\u548c\u65e0\u9700\u9884\u5b9a\u4e49\u5b57\u6bb5\u7684\u7279\u6027\uff0c\u4f7f\u5f97\u6570\u636e\u5efa\u6a21\u66f4\u52a0\u7075\u6d3b\u3002\u5728\u8bbe\u8ba1 MongoDB \u6a21\u5f0f\u65f6\uff0c\u5e94\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u7684\u67e5\u8be2\u9700\u6c42\u548c\u6570\u636e\u8bbf\u95ee\u6a21\u5f0f\u6765\u8fdb\u884c\u8bbe\u8ba1\u3002<\/p>\n<p> \u9999\u6e2f\u670d\u52a1\u5668\u9996\u9009\u540e\u6d6a\u4e91\uff0c\u63d0\u4f9b\u53ef\u9760\u7684\u4e91\u8ba1\u7b97\u670d\u52a1\u3002\u60a8\u53ef\u4ee5\u5728\u6211\u4eec\u7684\u5b98\u7f51\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u9999\u6e2f\u670d\u52a1\u5668\u3001\u7f8e\u56fd\u670d\u52a1\u5668\u548c\u4e91\u670d\u52a1\u5668\u7684\u4fe1\u606f\u3002<\/p>\n<p> <a href=\"https:\/\/idc.net\">\u70b9\u51fb\u8fd9\u91cc<\/a> \u4e86\u89e3\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB \u672f\u8bed - \u6a21\u5f0f MongoDB \u672f\u8bed - \u6a21\u5f0f \u4ec0\u4e48\u662f MongoDB \u6a21\u5f0f\uff1f \u5728 Mongo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7038],"tags":[],"class_list":["post-247411","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/247411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=247411"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/247411\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=247411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=247411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=247411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}