{"id":1085,"date":"2023-03-12T11:06:37","date_gmt":"2023-03-12T03:06:37","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1085"},"modified":"2023-04-29T11:41:23","modified_gmt":"2023-04-29T03:41:23","slug":"mongodb-backend-management-shell","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/12\/mongodb-backend-management-shell\/","title":{"rendered":"MongoDB\u540e\u53f0\u7ba1\u7406Shell"},"content":{"rendered":"<p>MongoDB Shell\u662fMongoDB\u81ea\u5e26\u7684\u4ea4\u4e92\u5f0fJavascript shell\uff0c\u7528\u6765\u5bf9MongoDB\u8fdb\u884c\u64cd\u4f5c\u548c\u7ba1\u7406\u7684\u4ea4\u4e92\u5f0f\u73af\u5883\u3002<\/p>\n<p>\u8fdb\u5165MongoDB\u540e\u53f0\u540e\uff0c\u9ed8\u8ba4\u4f1a\u94fe\u63a5\u5230 test\u6587\u6863\uff08\u6570\u636e\u5e93\uff09\uff1a<\/p>\n<p><!-- more --><\/p>\n<pre><code># mongo\nMongoDB shell version v3.6.4\nconnecting to: mongodb:\/\/127.0.0.1:27017\nMongoDB server version: 3.6.4\nWelcome to the MongoDB shell.<\/code><\/pre>\n<p>\u7531\u4e8e\u5b83\u662f\u4e00\u4e2aJavaScript shell\uff0c\u53ef\u4ee5\u8fd0\u884c\u4e00\u4e9b\u7b80\u5355\u7684\u7b97\u672f\u8fd0\u7b97\uff1a<\/p>\n<pre><code>> 4+4\n8\n> <\/code><\/pre>\n<p>\u73b0\u5728\u6211\u4eec\u63d2\u5165\u4e00\u4e9b\u7b80\u5355\u7684\u6570\u636e\uff0c\u5e76\u5bf9\u63d2\u5165\u7684\u6570\u636e\u8fdb\u884c\u68c0\u7d22\uff1a<\/p>\n<pre><code>> db.appblog.insert({x:10})\nWriteResult({ &quot;nInserted&quot; : 1 })\n> db.appblog.find()\n{ &quot;_id&quot; : ObjectId(&quot;5aead830134346012ef0f4bc&quot;), &quot;x&quot; : 10 }\n> <\/code><\/pre>\n<p>\u7b2c\u4e00\u4e2a\u547d\u4ee4\u5c06\u6570\u5b57 10 \u63d2\u5165\u5230 appblog \u96c6\u5408\u7684 x \u5b57\u6bb5\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB Shell\u662fMongoDB\u81ea\u5e26\u7684\u4ea4\u4e92\u5f0fJavascript shell\uff0c\u7528\u6765\u5bf9MongoDB\u8fdb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[300],"tags":[],"class_list":["post-1085","post","type-post","status-publish","format-standard","hentry","category-mongodb"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1085"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1085\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}