{"id":21629,"date":"2024-01-02T12:40:28","date_gmt":"2024-01-02T12:40:28","guid":{"rendered":"https:\/\/server.hk\/blog\/21629\/"},"modified":"2024-11-14T10:29:32","modified_gmt":"2024-11-14T02:29:32","slug":"how-to-fix-mongodb-error-code-34-cannotbackfillarray","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21629\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray"},"content":{"rendered":"<h1 id=\"how-to-fix-mongodb-error-code-34-cannotbackfillarray-FRqbBvbRmH\">\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray<\/h1>\n<p>MongoDB \u662f\u4e00\u500b\u53d7\u6b61\u8fce\u7684\u958b\u6e90 NoSQL \u6578\u64da\u5eab\uff0c\u63d0\u4f9b\u9ad8\u6027\u80fd\u3001\u53ef\u64f4\u5c55\u6027\u548c\u9748\u6d3b\u6027\u3002\u7136\u800c\uff0c\u50cf\u4efb\u4f55\u5176\u4ed6\u8edf\u4ef6\u4e00\u6a23\uff0c\u5b83\u4e5f\u53ef\u80fd\u9047\u5230\u9700\u8981\u89e3\u6c7a\u7684\u932f\u8aa4\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662f MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u6b64\u932f\u8aa4\u7684\u539f\u56e0\u4e26\u63d0\u4f9b\u9010\u6b65\u89e3\u6c7a\u65b9\u6848\u4f86\u4fee\u5fa9\u5b83\u3002<\/p>\n<h2 id=\"understanding-mongodb-error-code-34-cannotbackfillarray-FRqbBvbRmH\">\u4e86\u89e3 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray<\/h2>\n<p>\u7576\u5617\u8a66\u7528\u8d85\u904e\u8a72\u5b57\u6bb5\u5b9a\u7fa9\u7684\u6700\u5927\u5927\u5c0f\u7684\u503c\u66f4\u65b0\u6578\u7d44\u5b57\u6bb5\u6642\uff0c\u6703\u51fa\u73fe MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray\u3002MongoDB \u5c0d\u6578\u7d44\u5b57\u6bb5\u7684\u5927\u5c0f\u65bd\u52a0\u9650\u5236\uff0c\u9ed8\u8a8d\u70ba 16 \u5146\u5b57\u7bc0 (MB)\u3002\u5982\u679c\u60a8\u5617\u8a66\u7528\u8d85\u904e\u6b64\u9650\u5236\u7684\u503c\u66f4\u65b0\u6578\u7d44\u5b57\u6bb5\uff0c\u60a8\u5c07\u9047\u5230\u6b64\u932f\u8aa4\u3002<\/p>\n<h2 id=\"possible-causes-of-mongodb-error-code-34-cannotbackfillarray-FRqbBvbRmH\">MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray \u7684\u53ef\u80fd\u539f\u56e0<\/h2>\n<p>\u60a8\u53ef\u80fd\u6703\u9047\u5230\u6b64\u932f\u8aa4\u7684\u5e7e\u500b\u539f\u56e0\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u7d44\u5927\u5c0f\u904e\u5927\uff1a<\/strong>\u5982\u679c\u60a8\u5617\u8a66\u66f4\u65b0\u7684\u6578\u7d44\u904e\u5927\uff0c\u8d85\u904e\u4e86\u6700\u5927\u5927\u5c0f\u9650\u5236\uff0cMongoDB \u5c07\u5f15\u767c\u6b64\u932f\u8aa4\u3002<\/li>\n<li><strong>\u5b57\u6bb5\u985e\u578b\u4e0d\u6b63\u78ba\uff1a<\/strong>\u5982\u679c\u60a8\u5617\u8a66\u66f4\u65b0\u7684\u5b57\u6bb5\u4e0d\u662f\u6578\u7d44\u5b57\u6bb5\uff0cMongoDB \u5c07\u5f15\u767c\u6b64\u932f\u8aa4\u3002\u8acb\u78ba\u4fdd\u8a72\u5b57\u6bb5\u5728\u60a8\u7684\u67b6\u69cb\u4e2d\u5b9a\u7fa9\u70ba\u6578\u7d44\u3002<\/li>\n<li><strong>\u7121\u6548\u7684\u66f4\u65b0\u64cd\u4f5c\uff1a<\/strong>\u5982\u679c\u60a8\u4f7f\u7528\u4e86\u4e0d\u6b63\u78ba\u7684\u66f4\u65b0\u64cd\u4f5c\u6216\u8a9e\u6cd5\uff0cMongoDB \u53ef\u80fd\u6703\u5c07\u5176\u89e3\u91cb\u70ba\u5617\u8a66\u66f4\u65b0\u6578\u7d44\u5b57\u6bb5\uff0c\u4e26\u89f8\u767c\u6b64\u932f\u8aa4\u3002\u8acb\u4ed4\u7d30\u6aa2\u67e5\u60a8\u7684\u66f4\u65b0\u64cd\u4f5c\u662f\u5426\u6709\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"fixing-mongodb-error-code-34-cannotbackfillarray-FRqbBvbRmH\">\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray<\/h2>\n<p>\u8981\u89e3\u6c7a\u6b64\u932f\u8aa4\uff0c\u8acb\u9075\u5faa\u4ee5\u4e0b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"step-1-check-array-size-FRqbBvbRmH\">\u6b65\u9a5f 1\uff1a\u6aa2\u67e5\u6578\u7d44\u5927\u5c0f<\/h3>\n<p>\u9996\u5148\uff0c\u9a57\u8b49\u60a8\u5617\u8a66\u66f4\u65b0\u7684\u6578\u7d44\u7684\u5927\u5c0f\u3002\u5982\u679c\u5b83\u8d85\u904e\u9ed8\u8a8d\u9650\u5236 16 MB\uff0c\u60a8\u9700\u8981\u6e1b\u5c11\u5176\u5927\u5c0f\u3002\u8003\u616e\u5c07\u6578\u7d44\u62c6\u5206\u70ba\u66f4\u5c0f\u7684\u584a\u6216\u4f7f\u7528\u66f4\u7b26\u5408\u60a8\u9700\u6c42\u7684\u6578\u64da\u6a21\u578b\u3002<\/p>\n<h3 id=\"step-2-verify-field-type-FRqbBvbRmH\">\u6b65\u9a5f 2\uff1a\u9a57\u8b49\u5b57\u6bb5\u985e\u578b<\/h3>\n<p>\u78ba\u4fdd\u60a8\u6b63\u5728\u66f4\u65b0\u7684\u5b57\u6bb5\u5728\u60a8\u7684\u67b6\u69cb\u4e2d\u6b63\u78ba\u5b9a\u7fa9\u70ba\u6578\u7d44\u3002\u4ed4\u7d30\u6aa2\u67e5\u60a8\u7684\u67b6\u69cb\u5b9a\u7fa9\uff0c\u4ee5\u78ba\u8a8d\u5b57\u6bb5\u985e\u578b\u8a2d\u7f6e\u70ba\u6578\u7d44\u3002<\/p>\n<h3 id=\"step-3-review-update-operation-FRqbBvbRmH\">\u6b65\u9a5f 3\uff1a\u6aa2\u67e5\u66f4\u65b0\u64cd\u4f5c<\/h3>\n<p>\u6aa2\u67e5\u60a8\u7684\u66f4\u65b0\u64cd\u4f5c\uff0c\u4ee5\u78ba\u4fdd\u60a8\u4f7f\u7528\u6b63\u78ba\u7684\u8a9e\u6cd5\u548c\u64cd\u4f5c\u3002\u5982\u679c\u4e0d\u78ba\u5b9a\uff0c\u8acb\u53c3\u8003 MongoDB \u6587\u6a94\u6216\u5c0b\u6c42 MongoDB \u793e\u5340\u7684\u5e6b\u52a9\u3002<\/p>\n<h3 id=\"step-4-increase-array-size-limit-FRqbBvbRmH\">\u6b65\u9a5f 4\uff1a\u589e\u52a0\u6578\u7d44\u5927\u5c0f\u9650\u5236<\/h3>\n<p>\u5982\u679c\u6e1b\u5c11\u6578\u7d44\u5927\u5c0f\u6216\u4fee\u6539\u67b6\u69cb\u4e0d\u53ef\u884c\uff0c\u60a8\u53ef\u4ee5\u5728 MongoDB \u4e2d\u589e\u52a0\u6700\u5927\u6578\u7d44\u5927\u5c0f\u9650\u5236\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4fee\u6539 MongoDB \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 storage.maxArraySize \u53c3\u6578\u4f86\u5b8c\u6210\u3002\u7136\u800c\uff0c\u589e\u52a0\u6b64\u9650\u5236\u6642\u8acb\u8b39\u614e\uff0c\u56e0\u70ba\u9019\u53ef\u80fd\u6703\u5f71\u97ff\u6027\u80fd\u548c\u5167\u5b58\u4f7f\u7528\u3002<\/p>\n<h2 id=\"summary-FRqbBvbRmH\">\u7e3d\u7d50<\/h2>\n<p>MongoDB \u932f\u8aa4\u4ee3\u78bc &#8211; 34 &#8211; CannotBackfillArray \u767c\u751f\u5728\u5617\u8a66\u7528\u8d85\u904e\u6700\u5927\u5927\u5c0f\u9650\u5236\u7684\u503c\u66f4\u65b0\u6578\u7d44\u5b57\u6bb5\u6642\u3002\u8981\u4fee\u5fa9\u6b64\u932f\u8aa4\uff0c\u8acb\u6aa2\u67e5\u6578\u7d44\u5927\u5c0f\u3001\u9a57\u8b49\u5b57\u6bb5\u985e\u578b\u3001\u6aa2\u67e5\u66f4\u65b0\u64cd\u4f5c\u6216\u589e\u52a0\u6578\u7d44\u5927\u5c0f\u9650\u5236\u3002\u5982\u679c\u60a8\u9700\u8981\u53ef\u9760\u4e14\u9ad8\u6027\u80fd\u7684 VPS \u4e3b\u6a5f\u4f86\u904b\u884c\u60a8\u7684 MongoDB \u61c9\u7528\u7a0b\u5e8f\uff0c\u8acb\u8003\u616e <a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002\u6191\u85c9\u5176\u4e00\u6d41\u7684 VPS \u89e3\u6c7a\u65b9\u6848\uff0c\u60a8\u53ef\u4ee5\u78ba\u4fdd\u60a8\u7684 MongoDB \u90e8\u7f72\u7372\u5f97\u6700\u4f73\u6027\u80fd\u548c\u53ef\u64f4\u5c55\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4fee\u5fa9 MongoDB \u932f\u8aa4\u4ee3&#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-21629","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21629","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=21629"}],"version-history":[{"count":2,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21629\/revisions"}],"predecessor-version":[{"id":23797,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21629\/revisions\/23797"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}