{"id":4032,"date":"2025-04-19T16:25:25","date_gmt":"2025-04-19T07:25:25","guid":{"rendered":"https:\/\/eternalsphere.net\/echoes\/?p=4032"},"modified":"2025-06-22T07:46:52","modified_gmt":"2025-06-21T22:46:52","slug":"052kjia3mk65vnk","status":"publish","type":"post","link":"https:\/\/eternalsphere.net\/echoes\/index.php\/2025\/04\/19\/052kjia3mk65vnk\/","title":{"rendered":"MongoDB \u5347\u7ea7\u540e\u9700\u8bbe\u7f6e\u7684\u5173\u952e\u9879\uff1aFeature Compatibility Version\uff08FCV\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728\u4f7f\u7528 Docker \u6216\u5176\u4ed6\u65b9\u5f0f\u5c06 MongoDB \u5347\u7ea7\u5230\u5927\u7248\u672c\uff08\u5982 6.x \u279c 7.x\uff09\u540e\uff0c\u4f60\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">jsCopyEdit<code>db.adminCommand({ setFeatureCompatibilityVersion: \"7.0\", confirm: true })\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6761\u547d\u4ee4\u5e76\u4e0d\u662f\u53ef\u6709\u53ef\u65e0\u7684\u914d\u7f6e\uff0c\u800c\u662f\u5173\u7cfb\u5230\u7cfb\u7edf\u7a33\u5b9a\u6027\u548c\u672a\u6765\u53ef\u6269\u5c55\u6027\u7684\u91cd\u8981\u64cd\u4f5c\u3002\u4eca\u5929\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5c31\u6765\u4ecb\u7ecd\u4ec0\u4e48\u662f <strong>Feature Compatibility Version\uff08FCV\uff09<\/strong>\uff0c\u4e3a\u4ec0\u4e48\u6211\u4eec\u9700\u8981\u8bbe\u7f6e\u5b83\uff0c\u4ee5\u53ca\u8be5\u6ce8\u610f\u7684\u4e8b\u9879\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 \u4ec0\u4e48\u662f Feature Compatibility Version\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Feature Compatibility Version\uff08\u7b80\u79f0 FCV\uff09\u662f MongoDB \u63d0\u4f9b\u7684\u4e00\u79cd<strong>\u6570\u636e\u7ed3\u6784\u4e0e\u884c\u4e3a\u517c\u5bb9\u673a\u5236<\/strong>\u3002\u5b83\u7684\u6838\u5fc3\u76ee\u7684\u662f\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u8ba9\u4f60\u5728\u5347\u7ea7 MongoDB \u540e\uff0c\u4ecd\u7136\u80fd\u591f\u9009\u62e9\u4fdd\u7559\u65e7\u7248\u672c\u7684\u6570\u636e\u683c\u5f0f\u4e0e\u8fd0\u884c\u903b\u8f91\uff0c\u76f4\u5230\u4f60\u786e\u8ba4\u4e00\u5207\u7a33\u5b9a\uff0c\u518d\u542f\u7528\u65b0\u7248\u672c\u7279\u6027\u3002<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">FCV \u63a7\u5236\u7684\u5185\u5bb9\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7d22\u5f15\u683c\u5f0f<\/li>\n\n\n\n<li>\u6570\u636e\u5b58\u50a8\u7ed3\u6784<\/li>\n\n\n\n<li>\u805a\u5408\u884c\u4e3a<\/li>\n\n\n\n<li>\u65b0\u65e7\u8bed\u6cd5\u652f\u6301\u7b49<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2699\ufe0f \u4e3a\u4ec0\u4e48\u9700\u8981\u624b\u52a8\u8bbe\u7f6e FCV\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">MongoDB \u5347\u7ea7\u540e\uff0c\u9ed8\u8ba4\u5e76\u4e0d\u4f1a\u542f\u7528\u65b0\u7248\u672c\u7684\u5168\u90e8\u7279\u6027\u3002\u6bd4\u5982\uff0c\u4f60\u4ece MongoDB 6.0 \u5347\u7ea7\u5230\u4e86 7.0\uff0c\u5373\u4fbf\u8fd0\u884c\u7684\u662f 7.0 \u7684\u4e8c\u8fdb\u5236\u7248\u672c\uff0c\u7cfb\u7edf\u5185\u90e8\u4ecd\u7136\u4ee5 6.0 \u7684\u65b9\u5f0f\u8fd0\u884c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u65f6\u5019\uff0c\u5982\u679c\u4f60\u4e0d\u8bbe\u7f6e FCV\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e0d\u4f1a\u542f\u7528 7.0 \u7684\u65b0\u7279\u6027<\/strong><\/li>\n\n\n\n<li>\u4f9d\u65e7\u517c\u5bb9\u8001\u7684\u683c\u5f0f\uff08\u8fd9\u672c\u8eab\u662f\u4e3a\u4e86\u5b89\u5168\u548c\u53ef\u56de\u9000\uff09<\/li>\n\n\n\n<li>Rocket.Chat \u7b49\u5e94\u7528\u4ecd\u53ef\u80fd\u63d0\u793a \u201cMongoDB \u7248\u672c\u5df2\u8fc7\u65f6\u201d\u7684\u8b66\u544a<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u5982\u4f55\u8bbe\u7f6e FCV \u4e3a\u65b0\u7248\u672c\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u4f60\u786e\u8ba4\u7cfb\u7edf\u8fd0\u884c\u7a33\u5b9a\u3001\u6ca1\u6709\u56de\u9000\u7684\u9700\u6c42\u4e4b\u540e\uff0c\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">jsCopyEdit<code>db.adminCommand({ setFeatureCompatibilityVersion: \"7.0\", confirm: true })\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f \u6ce8\u610f\uff1a\u4ece MongoDB 7.x \u5f00\u59cb\uff0c\u4e3a\u4e86\u9632\u6b62\u8bef\u64cd\u4f5c\uff0c<strong>\u5fc5\u987b\u52a0\u4e0a <code>confirm: true<\/code><\/strong>\uff0c\u660e\u786e\u8868\u793a\u4f60\u7406\u89e3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8bbe\u7f6e\u4e4b\u540e\u4e0d\u53ef\u56de\u9000<\/li>\n\n\n\n<li>\u6570\u636e\u7ed3\u6784\u5c06\u53d1\u751f\u4e0d\u53ef\u9006\u7684\u53d8\u5316<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c\u6210\u529f\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u518d\u6b21\u786e\u8ba4\u5f53\u524d\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">jsCopyEdit<code>db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccc \u8bbe\u7f6e FCV \u7684\u6b63\u786e\u65f6\u673a<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u65f6\u673a<\/th><th>\u662f\u5426\u63a8\u8350\u8bbe\u7f6e FCV<\/th><\/tr><\/thead><tbody><tr><td>\u5347\u7ea7\u540e\u5c1a\u672a\u9a8c\u8bc1\u7cfb\u7edf\u7a33\u5b9a<\/td><td>\u274c \u4e0d\u5efa\u8bae\u7acb\u5373\u8bbe\u7f6e<\/td><\/tr><tr><td>\u7cfb\u7edf\u6d4b\u8bd5\u5b8c\u6210\u3001\u786e\u8ba4\u7a33\u5b9a<\/td><td>\u2705 \u63a8\u8350\u8bbe\u7f6e\u4e3a\u76ee\u6807\u7248\u672c<\/td><\/tr><tr><td>\u51c6\u5907\u542f\u7528\u65b0\u529f\u80fd\u6216\u90e8\u7f72\u751f\u4ea7<\/td><td>\u2705 \u5f3a\u70c8\u5efa\u8bae\u8bbe\u7f6e\u4e3a\u76ee\u6807\u7248\u672c<\/td><\/tr><tr><td>\u6709\u56de\u9000\u8ba1\u5212\u3001\u6d4b\u8bd5\u9636\u6bb5<\/td><td>\u274c \u6682\u4e0d\u8bbe\u7f6e\uff0c\u4fdd\u6301\u5f53\u524d\u517c\u5bb9\u6027\u66f4\u5b89\u5168<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde0 \u5c0f\u7ed3<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>FCV \u662f MongoDB \u5728\u7248\u672c\u5347\u7ea7\u4e2d\u7684\u4e00\u9879\u201c\u65ad\u8a00\u673a\u5236\u201d\uff0c\u8ba9\u4f60\u63a7\u5236\u4f55\u65f6\u542f\u7528\u65b0\u7279\u6027\uff1b<\/li>\n\n\n\n<li>\u8bbe\u7f6e\u4e3a <code>\"7.0\"<\/code> \u540e\uff0c\u610f\u5473\u7740\u6b63\u5f0f\u8fdb\u5165 MongoDB 7 \u7684\u6570\u636e\u6a21\u578b\uff0c\u4e0d\u518d\u517c\u5bb9\u65e7\u7248\u672c\u683c\u5f0f\uff1b<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883\uff0c<strong>\u5efa\u8bae\u5728\u5907\u4efd\u6216\u9a8c\u8bc1\u5b8c\u6bd5\u540e\u518d\u8bbe\u7f6e<\/strong>\uff1b<\/li>\n\n\n\n<li>\u4e00\u65e6\u8bbe\u7f6e FCV\uff0c\u4f60\u5c06\u65e0\u6cd5\u56de\u9000\u7248\u672c\uff0c<strong>\u9664\u975e\u901a\u8fc7\u624b\u52a8\u6570\u636e\u8fc1\u79fb\u6216\u4f7f\u7528 <code>mongodump\/restore<\/code> \u91cd\u5efa<\/strong>\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcce \u53c2\u8003\u547d\u4ee4\u6c47\u603b<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">bashCopyEdit<code># \u67e5\u770b\u5f53\u524d\u7248\u672c\ndb.version()\n\n# \u67e5\u770b\u5f53\u524d FCV \u8bbe\u7f6e\ndb.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })\n\n# \u8bbe\u7f6e\u4e3a\u65b0\u7248\u672c\uff08\u4e0d\u53ef\u9006\uff09\ndb.adminCommand({ setFeatureCompatibilityVersion: \"7.0\", confirm: true })\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3 MongoDB \u5347\u7ea7\u8fc7\u7a0b\u4e2d\u7684\u7ec6\u8282\u3002\u5982\u679c\u4f60\u6b63\u5728\u505a\u5927\u7248\u672c\u8fc1\u79fb\uff0c\u522b\u5fd8\u4e86\u5728\u8bbe\u7f6e FCV \u4e4b\u524d\u5148\u505a\u597d\u6570\u636e\u5907\u4efd\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528 Docker \u6216\u5176\u4ed6\u65b9\u5f0f\u5c06 MongoDB \u5347\u7ea7\u5230\u5927\u7248\u672c\uff08\u5982 6.x \u279c 7.x\uff09\u540e\uff0c\u4f60\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a jsCopyEditdb.adminCommand({ setFeatureCompatibilityVersion: &#8220;7.0&#8221;, confirm: true }) \u8fd9\u6761\u547d\u4ee4\u5e76\u4e0d\u662f\u53ef\u6709\u53ef\u65e0\u7684\u914d\u7f6e\uff0c\u800c\u662f\u5173\u7cfb\u5230\u7cfb\u7edf\u7a33\u5b9a\u6027\u548c\u672a\u6765\u53ef\u6269\u5c55\u6027\u7684\u91cd\u8981\u64cd\u4f5c\u3002\u4eca\u5929\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5c31\u6765\u4ecb\u7ecd\u4ec0\u4e48\u662f Feature Compatibility Version\uff08FCV\uff09\uff0c\u4e3a\u4ec0\u4e48\u6211\u4eec\u9700\u8981\u8bbe\u7f6e\u5b83\uff0c\u4ee5\u53ca\u8be5\u6ce8\u610f\u7684\u4e8b\u9879\u3002 \ud83d\udd27 \u4ec0\u4e48\u662f Feature Compatibility Version\uff1f Feature Compatibility Version\uff08\u7b80\u79f0 FCV\uff09\u662f MongoDB \u63d0\u4f9b\u7684\u4e00\u79cd\u6570\u636e\u7ed3\u6784\u4e0e\u884c\u4e3a\u517c\u5bb9\u673a\u5236\u3002\u5b83\u7684\u6838\u5fc3\u76ee\u7684\u662f\uff1a \u8ba9\u4f60\u5728\u5347\u7ea7 MongoDB \u540e\uff0c\u4ecd\u7136\u80fd\u591f\u9009\u62e9\u4fdd\u7559\u65e7\u7248\u672c\u7684\u6570\u636e\u683c\u5f0f\u4e0e\u8fd0\u884c\u903b\u8f91\uff0c\u76f4\u5230\u4f60\u786e\u8ba4\u4e00\u5207\u7a33\u5b9a\uff0c\u518d\u542f\u7528\u65b0\u7248\u672c\u7279\u6027\u3002 FCV \u63a7\u5236\u7684\u5185\u5bb9\u5305\u62ec\uff1a \u2699\ufe0f \u4e3a\u4ec0\u4e48\u9700\u8981\u624b\u52a8\u8bbe\u7f6e FCV\uff1f MongoDB \u5347\u7ea7\u540e\uff0c\u9ed8\u8ba4\u5e76\u4e0d\u4f1a\u542f\u7528\u65b0\u7248\u672c\u7684\u5168\u90e8\u7279\u6027\u3002\u6bd4\u5982\uff0c\u4f60\u4ece MongoDB 6.0 \u5347\u7ea7\u5230\u4e86 7.0\uff0c\u5373\u4fbf\u8fd0\u884c\u7684\u662f 7.0 \u7684\u4e8c\u8fdb\u5236\u7248\u672c\uff0c\u7cfb\u7edf\u5185\u90e8\u4ecd\u7136\u4ee5 6.0 \u7684\u65b9\u5f0f\u8fd0\u884c\u3002 \u8fd9\u65f6\u5019\uff0c\u5982\u679c\u4f60\u4e0d\u8bbe\u7f6e FCV\uff1a \u2705 &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"class_list":["post-4032","post","type-post","status-publish","format-standard","hentry","category-y8behyrmw-2lc"],"_links":{"self":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/comments?post=4032"}],"version-history":[{"count":2,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4032\/revisions"}],"predecessor-version":[{"id":4357,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4032\/revisions\/4357"}],"wp:attachment":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/media?parent=4032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/categories?post=4032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/tags?post=4032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}