{"id":21505,"date":"2024-01-02T10:30:24","date_gmt":"2024-01-02T10:30:24","guid":{"rendered":"https:\/\/server.hk\/blog\/21505\/"},"modified":"2024-11-14T10:31:39","modified_gmt":"2024-11-14T02:31:39","slug":"mongodb-glossary-database","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21505\/","title":{"rendered":"MongoDB \u8a5e\u5f59\u8868 &#8211; \u6578\u64da\u5eab"},"content":{"rendered":"<h1 id=\"mongodb-glossary-database-yELjqkTLJd\">MongoDB \u8a5e\u5f59\u8868 &#8211; \u6578\u64da\u5eab\uff08Database\uff09<\/h1>\n<p>\u5728\u73fe\u4ee3\u79d1\u6280\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u5728\u5b58\u5132\u548c\u7ba1\u7406\u5927\u91cf\u6578\u64da\u65b9\u9762\u626e\u6f14\u8457\u81f3\u95dc\u91cd\u8981\u7684\u89d2\u8272\u3002MongoDB \u662f\u4e00\u7a2e\u6d41\u884c\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u4ee5\u5176\u9748\u6d3b\u6027\u3001\u53ef\u64f4\u5c55\u6027\u548c\u6027\u80fd\u800c\u805e\u540d\u3002\u70ba\u4e86\u66f4\u597d\u5730\u7406\u89e3 MongoDB \u53ca\u5176\u529f\u80fd\uff0c\u719f\u6089\u8207\u4e4b\u76f8\u95dc\u7684\u8853\u8a9e\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u63a2\u8a0e\u5728 MongoDB \u4e0a\u4e0b\u6587\u4e2d\u6578\u64da\u5eab\u7684\u6982\u5ff5\u3002<\/p>\n<h2 id=\"what-is-a-database-yELjqkTLJd\">\u4ec0\u9ebc\u662f\u6578\u64da\u5eab\uff1f<\/h2>\n<p>\u6578\u64da\u5eab\u662f\u7d44\u7e54\u548c\u5b58\u5132\u6578\u64da\u7684\u7d50\u69cb\u5316\u96c6\u5408\uff0c\u4fbf\u65bc\u8a2a\u554f\u3001\u6aa2\u7d22\u548c\u7ba1\u7406\u3002\u5b83\u4f5c\u70ba\u5404\u7a2e\u4fe1\u606f\u7684\u5b58\u5132\u5eab\uff0c\u4f8b\u5982\u5ba2\u6236\u8a73\u7d30\u4fe1\u606f\u3001\u7522\u54c1\u5eab\u5b58\u6216\u8ca1\u52d9\u8a18\u9304\u3002\u6578\u64da\u5eab\u63d0\u4f9b\u4e86\u4e00\u7a2e\u9ad8\u6548\u5b58\u5132\u3001\u6aa2\u7d22\u3001\u66f4\u65b0\u548c\u522a\u9664\u6578\u64da\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u5728 MongoDB \u4e2d\uff0c\u6578\u64da\u5eab\u662f\u96c6\u5408\u7684\u5bb9\u5668\u3002\u5b83\u662f\u76f8\u95dc\u6578\u64da\u7684\u908f\u8f2f\u5206\u7d44\uff0c\u985e\u4f3c\u65bc\u5305\u542b\u6587\u4ef6\u7684\u6587\u4ef6\u593e\u3002\u6bcf\u500b\u6578\u64da\u5eab\u90fd\u6709\u81ea\u5df1\u7684\u4e00\u7d44\u96c6\u5408\uff0c\u9019\u4e9b\u96c6\u5408\u9032\u4e00\u6b65\u7d30\u5206\u70ba\u6587\u6a94\u3002<\/p>\n<h2 id=\"key-features-of-mongodb-databases-yELjqkTLJd\">MongoDB \u6578\u64da\u5eab\u7684\u4e3b\u8981\u7279\u5fb5<\/h2>\n<p>MongoDB \u6578\u64da\u5eab\u63d0\u4f9b\u4e86\u5e7e\u500b\u4e3b\u8981\u7279\u5fb5\uff0c\u4f7f\u5176\u6210\u70ba\u8a31\u591a\u61c9\u7528\u7a0b\u5e8f\u7684\u71b1\u9580\u9078\u64c7\uff1a<\/p>\n<h3 id=\"1-scalability-yELjqkTLJd\">1. \u53ef\u64f4\u5c55\u6027\uff1a<\/h3>\n<p>MongoDB \u6578\u64da\u5eab\u8a2d\u8a08\u70ba\u6c34\u5e73\u64f4\u5c55\uff0c\u5141\u8a31\u60a8\u5c07\u6578\u64da\u5206\u4f48\u5728\u591a\u500b\u4f3a\u670d\u5668\u6216\u96c6\u7fa4\u4e0a\u3002\u9019\u4f7f\u5f97\u61c9\u7528\u7a0b\u5e8f\u80fd\u5920\u9ad8\u6548\u8655\u7406\u5927\u91cf\u6578\u64da\u548c\u9ad8\u6d41\u91cf\u8ca0\u8f09\u3002<\/p>\n<h3 id=\"2-flexibility-yELjqkTLJd\">2. \u9748\u6d3b\u6027\uff1a<\/h3>\n<p>MongoDB \u7684\u9748\u6d3b\u6a21\u5f0f\u5141\u8a31\u60a8\u5728\u6c92\u6709\u9810\u5b9a\u7d50\u69cb\u7684\u60c5\u6cc1\u4e0b\u5b58\u5132\u6578\u64da\u3002\u8207\u50b3\u7d71\u7684\u95dc\u806f\u6578\u64da\u5eab\u4e0d\u540c\uff0cMongoDB \u4e0d\u9700\u8981\u56fa\u5b9a\u7684\u6a21\u5f0f\uff0c\u9019\u4f7f\u5f97\u9069\u61c9\u8b8a\u5316\u7684\u6578\u64da\u9700\u6c42\u8b8a\u5f97\u66f4\u5bb9\u6613\u3002<\/p>\n<h3 id=\"3-high-performance-yELjqkTLJd\">3. \u9ad8\u6027\u80fd\uff1a<\/h3>\n<p>MongoDB \u6578\u64da\u5eab\u91dd\u5c0d\u9ad8\u6027\u80fd\u9032\u884c\u4e86\u512a\u5316\u3002\u5b83\u5011\u4f7f\u7528\u6587\u6a94\u5c0e\u5411\u7684\u6578\u64da\u6a21\u578b\uff0c\u610f\u5473\u8457\u76f8\u95dc\u6578\u64da\u4e00\u8d77\u5b58\u5132\uff0c\u6e1b\u5c11\u4e86\u8907\u96dc\u806f\u63a5\u7684\u9700\u6c42\uff0c\u4e26\u63d0\u9ad8\u4e86\u67e5\u8a62\u6027\u80fd\u3002<\/p>\n<h3 id=\"4-replication-and-fault-tolerance-yELjqkTLJd\">4. \u8907\u88fd\u548c\u5bb9\u932f\uff1a<\/h3>\n<p>MongoDB \u6578\u64da\u5eab\u652f\u6301\u8907\u88fd\uff0c\u5141\u8a31\u60a8\u5728\u4e0d\u540c\u4f3a\u670d\u5668\u4e0a\u5275\u5efa\u6578\u64da\u7684\u591a\u500b\u526f\u672c\u3002\u9019\u63d0\u4f9b\u4e86\u5bb9\u932f\u80fd\u529b\uff0c\u78ba\u4fdd\u5373\u4f7f\u5728\u786c\u4ef6\u6545\u969c\u6216\u7db2\u7d61\u554f\u984c\u767c\u751f\u6642\uff0c\u6578\u64da\u4ecd\u7136\u53ef\u7528\u3002<\/p>\n<h3 id=\"5-indexing-yELjqkTLJd\">5. \u7d22\u5f15\uff1a<\/h3>\n<p>MongoDB \u6578\u64da\u5eab\u652f\u6301\u5404\u7a2e\u985e\u578b\u7684\u7d22\u5f15\uff0c\u4f8b\u5982\u55ae\u5b57\u6bb5\u7d22\u5f15\u3001\u8907\u5408\u7d22\u5f15\u548c\u5730\u7406\u7a7a\u9593\u7d22\u5f15\u3002\u7d22\u5f15\u901a\u904e\u5141\u8a31\u6578\u64da\u5eab\u5feb\u901f\u5b9a\u4f4d\u548c\u6aa2\u7d22\u6240\u9700\u6578\u64da\u4f86\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\u3002<\/p>\n<h2 id=\"working-with-mongodb-databases-yELjqkTLJd\">\u4f7f\u7528 MongoDB \u6578\u64da\u5eab<\/h2>\n<p>\u8981\u4f7f\u7528 MongoDB \u6578\u64da\u5eab\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 MongoDB shell \u6216\u591a\u7a2e\u53ef\u7528\u7684\u9a45\u52d5\u7a0b\u5e8f\u548c\u5eab\u4f86\u652f\u6301\u4e0d\u540c\u7684\u7de8\u7a0b\u8a9e\u8a00\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u4f7f\u7528 MongoDB shell \u5275\u5efa\u6578\u64da\u5eab\u7684\u793a\u4f8b\uff1a<\/p>\n<pre>\r\n<code>use mydatabase<\/code>\r\n<\/pre>\n<p>\u6b64\u547d\u4ee4\u5c07\u5275\u5efa\u4e00\u500b\u540d\u70ba &#8220;mydatabase&#8221; \u7684\u65b0\u6578\u64da\u5eab\uff08\u5982\u679c\u5c1a\u4e0d\u5b58\u5728\uff09\u3002\u7136\u5f8c\uff0c\u60a8\u53ef\u4ee5\u958b\u59cb\u5275\u5efa\u96c6\u5408\u4e26\u5c07\u6587\u6a94\u63d2\u5165\u5176\u4e2d\u3002<\/p>\n<h2 id=\"summary-yELjqkTLJd\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u4e4b\uff0c\u6578\u64da\u5eab\u662f MongoDB \u7684\u57fa\u672c\u7d44\u6210\u90e8\u5206\uff0c\u4f5c\u70ba\u96c6\u5408\u548c\u6587\u6a94\u7684\u5bb9\u5668\u3002MongoDB \u6578\u64da\u5eab\u63d0\u4f9b\u53ef\u64f4\u5c55\u6027\u3001\u9748\u6d3b\u6027\u3001\u9ad8\u6027\u80fd\u3001\u8907\u88fd\u3001\u5bb9\u932f\u548c\u7d22\u5f15\u80fd\u529b\u3002\u7406\u89e3\u8207 MongoDB \u76f8\u95dc\u7684\u8853\u8a9e\u5c0d\u65bc\u6709\u6548\u4f7f\u7528\u9019\u500b\u5f37\u5927\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6709\u8208\u8da3\u63a2\u7d22 MongoDB \u7684\u529f\u80fd\u4ee5\u53ca\u5b83\u5982\u4f55\u4f7f\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\u53d7\u76ca\uff0c\u8003\u616e\u8a2a\u554f <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS \u8a17\u7ba1<\/a>\u3002\u901a\u904e\u4ed6\u5011\u4e00\u6d41\u7684 VPS \u89e3\u6c7a\u65b9\u6848\uff0c\u60a8\u53ef\u4ee5\u5728\u53ef\u9760\u7684\u8a17\u7ba1\u74b0\u5883\u4e2d\u9ad4\u9a57 MongoDB \u7684\u5f37\u5927\u548c\u9748\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB \u8a5e\u5f59\u8868 &#038;#82&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-21505","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=21505"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21505\/revisions"}],"predecessor-version":[{"id":23959,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21505\/revisions\/23959"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}