{"id":63642,"date":"2024-10-14T01:15:14","date_gmt":"2024-10-13T17:15:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/63642\/"},"modified":"2024-10-14T01:15:15","modified_gmt":"2024-10-13T17:15:15","slug":"mongodb-2-2%e7%89%88%e6%9c%ac%e7%99%bc%e5%b8%83%e4%b8%a6%e7%99%bc%e6%80%a7%e8%83%bd%e5%a2%9e%e5%bc%b7","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/63642\/","title":{"rendered":"MongoDB 2.2\u7248\u672c\u767c\u5e03\u4e26\u767c\u6027\u80fd\u589e\u5f37"},"content":{"rendered":"<h1 id=\"mongodb-2-2%e7%89%88%e6%9c%ac%e7%99%bc%e5%b8%83%e4%b8%a6%e7%99%bc%e6%80%a7%e8%83%bd%e5%a2%9e%e5%bc%b7-cFsznOpHcg\">MongoDB 2.2\u7248\u672c\u767c\u5e03\u4e26\u767c\u6027\u80fd\u589e\u5f37<\/h1>\n<p>MongoDB\u662f\u4e00\u500b\u6d41\u884c\u7684NoSQL\u6578\u64da\u5eab\uff0c\u56e0\u5176\u9748\u6d3b\u7684\u6578\u64da\u6a21\u578b\u548c\u9ad8\u6027\u80fd\u800c\u53d7\u5230\u5ee3\u6cdb\u4f7f\u7528\u3002\u96a8\u8457\u6578\u64da\u91cf\u7684\u589e\u9577\u548c\u61c9\u7528\u9700\u6c42\u7684\u8b8a\u5316\uff0cMongoDB\u7684\u958b\u767c\u5718\u968a\u4e0d\u65b7\u63a8\u51fa\u65b0\u7248\u672c\uff0c\u4ee5\u63d0\u5347\u5176\u6027\u80fd\u548c\u529f\u80fd\u30022013\u5e74\uff0cMongoDB 2.2\u7248\u672c\u7684\u767c\u5e03\u6a19\u8a8c\u8457\u5176\u5728\u4e26\u767c\u6027\u80fd\u65b9\u9762\u7684\u4e00\u6b21\u91cd\u5927\u63d0\u5347\u3002<\/p>\n<h2 id=\"%e4%b8%a6%e7%99%bc%e6%80%a7%e8%83%bd%e7%9a%84%e6%8c%91%e6%88%b0-cFsznOpHcg\">\u4e26\u767c\u6027\u80fd\u7684\u6311\u6230<\/h2>\n<p>\u5728\u591a\u7528\u6236\u74b0\u5883\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u4e26\u767c\u6027\u80fd\u81f3\u95dc\u91cd\u8981\u3002\u96a8\u8457\u7528\u6236\u6578\u91cf\u7684\u589e\u52a0\uff0c\u6578\u64da\u5eab\u9700\u8981\u80fd\u5920\u540c\u6642\u8655\u7406\u591a\u500b\u8acb\u6c42\uff0c\u800c\u4e0d\u6703\u5c0e\u81f4\u6027\u80fd\u4e0b\u964d\u3002MongoDB\u5728\u65e9\u671f\u7248\u672c\u4e2d\u5df2\u7d93\u5177\u5099\u4e86\u4e00\u5b9a\u7684\u4e26\u767c\u8655\u7406\u80fd\u529b\uff0c\u4f46\u57282.2\u7248\u672c\u4e2d\uff0c\u958b\u767c\u5718\u968a\u91dd\u5c0d\u9019\u4e00\u554f\u984c\u9032\u884c\u4e86\u6df1\u5165\u7684\u512a\u5316\u3002<\/p>\n<h2 id=\"mongodb-2-2%e7%9a%84%e4%b8%bb%e8%a6%81%e6%94%b9%e9%80%b2-cFsznOpHcg\">MongoDB 2.2\u7684\u4e3b\u8981\u6539\u9032<\/h2>\n<ul>\n<li><strong>\u67e5\u8a62\u512a\u5316\u5668\u7684\u6539\u9032\uff1a<\/strong>MongoDB 2.2\u5f15\u5165\u4e86\u65b0\u7684\u67e5\u8a62\u512a\u5316\u5668\uff0c\u80fd\u5920\u66f4\u6709\u6548\u5730\u9078\u64c7\u6700\u4f73\u7684\u67e5\u8a62\u8a08\u5283\uff0c\u5f9e\u800c\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\u3002<\/li>\n<li><strong>\u5beb\u5165\u6027\u80fd\u7684\u63d0\u5347\uff1a<\/strong>\u901a\u904e\u6539\u9032\u5beb\u5165\u64cd\u4f5c\u7684\u8655\u7406\u65b9\u5f0f\uff0cMongoDB 2.2\u80fd\u5920\u5728\u9ad8\u4e26\u767c\u60c5\u6cc1\u4e0b\u4fdd\u6301\u7a69\u5b9a\u7684\u5beb\u5165\u6027\u80fd\uff0c\u9019\u5c0d\u65bc\u9700\u8981\u983b\u7e41\u66f4\u65b0\u6578\u64da\u7684\u61c9\u7528\u5c24\u70ba\u91cd\u8981\u3002<\/li>\n<li><strong>\u7d22\u5f15\u7684\u589e\u5f37\uff1a<\/strong>\u65b0\u7248\u672c\u652f\u6301\u66f4\u8907\u96dc\u7684\u7d22\u5f15\u985e\u578b\uff0c\u9019\u4f7f\u5f97\u67e5\u8a62\u901f\u5ea6\u66f4\u5feb\uff0c\u4e26\u4e14\u80fd\u5920\u66f4\u597d\u5730\u8655\u7406\u5927\u6578\u64da\u96c6\u3002<\/li>\n<li><strong>\u8907\u88fd\u96c6\u7684\u6539\u9032\uff1a<\/strong>MongoDB 2.2\u5c0d\u8907\u88fd\u96c6\u7684\u6027\u80fd\u9032\u884c\u4e86\u512a\u5316\uff0c\u6e1b\u5c11\u4e86\u4e3b\u5f9e\u4e4b\u9593\u7684\u5ef6\u9072\uff0c\u5f9e\u800c\u63d0\u9ad8\u4e86\u6574\u9ad4\u7684\u6578\u64da\u4e00\u81f4\u6027\u548c\u53ef\u7528\u6027\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%af%a6%e9%9a%9b%e6%87%89%e7%94%a8%e4%b8%ad%e7%9a%84%e6%80%a7%e8%83%bd%e6%8f%90%e5%8d%87-cFsznOpHcg\">\u5be6\u969b\u61c9\u7528\u4e2d\u7684\u6027\u80fd\u63d0\u5347<\/h2>\n<p>\u5728\u5be6\u969b\u61c9\u7528\u4e2d\uff0cMongoDB 2.2\u7684\u6027\u80fd\u63d0\u5347\u5f97\u5230\u4e86\u5ee3\u6cdb\u7684\u8a8d\u53ef\u3002\u4f8b\u5982\uff0c\u5728\u4e00\u500b\u9ad8\u6d41\u91cf\u7684\u96fb\u5b50\u5546\u52d9\u7db2\u7ad9\u4e2d\uff0c\u4f7f\u7528MongoDB 2.2\u5f8c\uff0c\u67e5\u8a62\u97ff\u61c9\u6642\u9593\u6e1b\u5c11\u4e86\u7d0430%\u3002\u9019\u5c0d\u65bc\u7528\u6236\u9ad4\u9a57\u7684\u63d0\u5347\u81f3\u95dc\u91cd\u8981\uff0c\u56e0\u70ba\u7528\u6236\u901a\u5e38\u5c0d\u65bc\u52a0\u8f09\u6642\u9593\u975e\u5e38\u654f\u611f\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u5c0d\u65bc\u9700\u8981\u8655\u7406\u5927\u91cf\u5beb\u5165\u64cd\u4f5c\u7684\u61c9\u7528\uff0c\u5982\u793e\u4ea4\u5a92\u9ad4\u5e73\u53f0\uff0cMongoDB 2.2\u7684\u5beb\u5165\u6027\u80fd\u63d0\u5347\u4f7f\u5f97\u7cfb\u7d71\u80fd\u5920\u66f4\u597d\u5730\u61c9\u5c0d\u9ad8\u4e26\u767c\u7684\u5beb\u5165\u8acb\u6c42\uff0c\u5f9e\u800c\u907f\u514d\u4e86\u56e0\u70ba\u5beb\u5165\u74f6\u9838\u800c\u5c0e\u81f4\u7684\u6578\u64da\u4e1f\u5931\u6216\u5ef6\u9072\u3002<\/p>\n<h2 id=\"%e4%bb%a3%e7%a2%bc%e7%a4%ba%e4%be%8b-cFsznOpHcg\">\u4ee3\u78bc\u793a\u4f8b<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684MongoDB\u67e5\u8a62\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u5229\u7528\u65b0\u7248\u672c\u7684\u67e5\u8a62\u512a\u5316\u5668\u4f86\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\uff1a<\/p>\n<pre><code>\ndb.collection.find({ \"status\": \"active\" }).sort({ \"createdAt\": -1 }).limit(10);\n<\/code><\/pre>\n<p>\u9019\u6bb5\u4ee3\u78bc\u5c07\u67e5\u8a62\u6240\u6709\u72c0\u614b\u70ba\u201cactive\u201d\u7684\u6587\u6a94\uff0c\u4e26\u6839\u64da\u5275\u5efa\u6642\u9593\u9032\u884c\u6392\u5e8f\uff0c\u6700\u7d42\u9650\u5236\u8fd4\u56de\u7684\u7d50\u679c\u6578\u91cf\u3002\u901a\u904e\u4f7f\u7528\u7d22\u5f15\uff0c\u9019\u6a23\u7684\u67e5\u8a62\u5728MongoDB 2.2\u4e2d\u80fd\u5920\u66f4\u5feb\u5730\u57f7\u884c\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-cFsznOpHcg\">\u7d50\u8ad6<\/h2>\n<p>MongoDB 2.2\u7248\u672c\u7684\u767c\u5e03\u70ba\u7528\u6236\u5e36\u4f86\u4e86\u986f\u8457\u7684\u4e26\u767c\u6027\u80fd\u63d0\u5347\uff0c\u9019\u4f7f\u5f97\u5b83\u5728\u8655\u7406\u9ad8\u6d41\u91cf\u548c\u9ad8\u4e26\u767c\u7684\u61c9\u7528\u5834\u666f\u4e2d\u66f4\u52a0\u5f97\u5fc3\u61c9\u624b\u3002\u96a8\u8457\u6578\u64da\u9700\u6c42\u7684\u6301\u7e8c\u589e\u9577\uff0c\u9078\u64c7\u4e00\u500b\u6027\u80fd\u512a\u8d8a\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u5c07\u6210\u70ba\u4f01\u696d\u6210\u529f\u7684\u95dc\u9375\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6027\u80fd\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528MongoDB\u4e26\u642d\u914d\u6211\u5011\u7684<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u670d\u52d9\uff0c\u4ee5\u7372\u5f97\u6700\u4f73\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB 2.2\u7248\u672c\u767c\u5e03\uff0c\u5e36\u4f86\u986f\u8457\u7684\u4e26\u767c\u6027\u80fd\u589e\u5f37\uff0c\u63d0\u5347\u6578\u64da\u8655\u7406\u6548\u7387\uff0c\u6eff\u8db3\u9ad8\u9700\u6c42\u61c9\u7528\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-63642","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/63642","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"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=63642"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/63642\/revisions"}],"predecessor-version":[{"id":63643,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/63642\/revisions\/63643"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=63642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=63642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=63642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}