{"id":29299,"date":"2022-12-04T23:29:54","date_gmt":"2023-08-10T01:17:49","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/"},"modified":"2025-08-12T13:24:43","modified_gmt":"2025-08-12T05:24:43","slug":"%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/","title":{"rendered":"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09"},"content":{"rendered":"<h1>\u9996\u5148\u901a\u8fc7\u4f7f\u7528Oracle Database API for MongoDB\uff0c\u5728MongoDB\u5ba2\u6237\u7aef\u548c\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u53ef\u4ee5\u8bbf\u95eeAutonomous JSON Database\uff0c\u5e76\u4e14\u53ef\u4ee5\u50cfMongoDB\u4e00\u6837\u64cd\u4f5cAutonomous JSON Database\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u6211\u5c1d\u8bd5\u4f7f\u7528MongoDB Shell\u4f5c\u4e3aMongoDB\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u81ea\u4e3bJSON\u6570\u636e\u5e93\u3002<\/p>\n<h1>\u521b\u5efa\u4e00\u4e2aCompute\u5b9e\u4f8b\u3002\u8fd9\u6b21\u6211\u4eec\u9009\u62e9\u4e86Oracle Linux 7.9\u4f5c\u4e3a\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5e76\u521b\u5efa\u4e86\u4e00\u4e2aCompute\u5b9e\u4f8b\u3002<\/p>\n<h1>2. MongoDB\u7684\u5b89\u88c5\u548c\u51c6\u5907\u5de5\u4f5c\u4e3a\u4e86\u6bd4\u8f83MongoDB\u548cAutonomous JSON Database\uff0c\u6211\u4eec\u5c06\u5728\u521b\u5efa\u7684Compute\u5b9e\u4f8b\u4e2d\u5b89\u88c5MongoDB\u3002<\/p>\n<p>\u6dfb\u52a0MongoDB 5.0\u7684yum\u5b58\u50a8\u5e93\u3002<\/p>\n<pre class=\"post-pre\"><code>[mongodb-org-5.0]\r\nname=MongoDB Repository\r\nbaseurl=https:\/\/repo.mongodb.org\/yum\/redhat\/$releasever\/mongodb-org\/5.0\/x86_64\/\r\ngpgcheck=1\r\nenabled=1\r\ngpgkey=https:\/\/www.mongodb.org\/static\/pgp\/server-5.0.asc\r\n<\/code><\/pre>\n<p>\u4f7f\u7528yum install\u547d\u4ee4\u5b89\u88c5MongoDB\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sudo yum install mongodb-org-5.0.5 mongodb-org-server-5.0.5 mongodb-org-shell-5.0.5 mongodb-org-mongos-5.0.5 mongodb-org-tools-5.0.5\r\nLoaded plugins: langpacks, osmsplugin, ulninfo\r\nThis system is receiving updates from OSMS.\r\nmongodb-org-5.0                                        | 2.5 kB     00:00     \r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package mongodb-org.x86_64 0:5.0.5-1.el7 will be installed\r\n--&gt; Processing Dependency: mongodb-org-database for package: mongodb-org-5.0.5-1.el7.x86_64\r\n---&gt; Package mongodb-org-mongos.x86_64 0:5.0.5-1.el7 will be installed\r\n---&gt; Package mongodb-org-server.x86_64 0:5.0.5-1.el7 will be installed\r\n---&gt; Package mongodb-org-shell.x86_64 0:5.0.5-1.el7 will be installed\r\n---&gt; Package mongodb-org-tools.x86_64 0:5.0.5-1.el7 will be installed\r\n--&gt; Running transaction check\r\n---&gt; Package mongodb-org-database.x86_64 0:5.0.5-1.el7 will be installed\r\n--&gt; Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n==============================================================================\r\n Package                 Arch      Version           Repository          Size\r\n==============================================================================\r\nInstalling:\r\n mongodb-org             x86_64    5.0.5-1.el7       mongodb-org-5.0    6.1 k\r\n mongodb-org-mongos      x86_64    5.0.5-1.el7       mongodb-org-5.0     19 M\r\n mongodb-org-server      x86_64    5.0.5-1.el7       mongodb-org-5.0     28 M\r\n mongodb-org-shell       x86_64    5.0.5-1.el7       mongodb-org-5.0     15 M\r\n mongodb-org-tools       x86_64    5.0.5-1.el7       mongodb-org-5.0    6.1 k\r\nInstalling for dependencies:\r\n mongodb-org-database    x86_64    5.0.5-1.el7       mongodb-org-5.0    6.2 k\r\n\r\nTransaction Summary\r\n==============================================================================\r\nInstall  5 Packages (+1 Dependent package)\r\n\r\nTotal download size: 62 M\r\nInstalled size: 231 M\r\nIs this ok [y\/d\/N]: y\r\nDownloading packages:\r\n(1\/6): mongodb-org-database-5.0.5-1.el7.x86_64.rpm       | 6.2 kB   00:00     \r\n(2\/6): mongodb-org-5.0.5-1.el7.x86_64.rpm                | 6.1 kB   00:00     \r\n(3\/6): mongodb-org-mongos-5.0.5-1.el7.x86_64.rpm         |  19 MB   00:00     \r\n(4\/6): mongodb-org-server-5.0.5-1.el7.x86_64.rpm         |  28 MB   00:00     \r\n(5\/6): mongodb-org-shell-5.0.5-1.el7.x86_64.rpm          |  15 MB   00:00     \r\n(6\/6): mongodb-org-tools-5.0.5-1.el7.x86_64.rpm          | 6.1 kB   00:00     \r\n------------------------------------------------------------------------------\r\nTotal                                             39 MB\/s |  62 MB  00:01     \r\nRunning transaction check\r\nRunning transaction test\r\nTransaction test succeeded\r\nRunning transaction\r\n  Installing : mongodb-org-mongos-5.0.5-1.el7.x86_64                      1\/6 \r\n  Installing : mongodb-org-tools-5.0.5-1.el7.x86_64                       2\/6 \r\n  Installing : mongodb-org-server-5.0.5-1.el7.x86_64                      3\/6 \r\nCreated symlink from \/etc\/systemd\/system\/multi-user.target.wants\/mongod.service to \/usr\/lib\/systemd\/system\/mongod.service.\r\n  Installing : mongodb-org-shell-5.0.5-1.el7.x86_64                       4\/6 \r\n  Installing : mongodb-org-database-5.0.5-1.el7.x86_64                    5\/6 \r\n  Installing : mongodb-org-5.0.5-1.el7.x86_64                             6\/6 \r\n  Verifying  : mongodb-org-shell-5.0.5-1.el7.x86_64                       1\/6 \r\n  Verifying  : mongodb-org-server-5.0.5-1.el7.x86_64                      2\/6 \r\n  Verifying  : mongodb-org-tools-5.0.5-1.el7.x86_64                       3\/6 \r\n  Verifying  : mongodb-org-mongos-5.0.5-1.el7.x86_64                      4\/6 \r\n  Verifying  : mongodb-org-database-5.0.5-1.el7.x86_64                    5\/6 \r\n  Verifying  : mongodb-org-5.0.5-1.el7.x86_64                             6\/6 \r\n\r\nInstalled:\r\n  mongodb-org.x86_64 0:5.0.5-1.el7                                            \r\n  mongodb-org-mongos.x86_64 0:5.0.5-1.el7                                     \r\n  mongodb-org-server.x86_64 0:5.0.5-1.el7                                     \r\n  mongodb-org-shell.x86_64 0:5.0.5-1.el7                                      \r\n  mongodb-org-tools.x86_64 0:5.0.5-1.el7                                      \r\n\r\nDependency Installed:\r\n  mongodb-org-database.x86_64 0:5.0.5-1.el7                                   \r\n\r\nComplete!\r\n[opc@work ~]$ \r\n<\/code><\/pre>\n<p>\u542f\u52a8MongoDB\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sudo systemctl start mongod\r\n<\/code><\/pre>\n<p>\u6211\u5c06\u68c0\u67e5MongoDB\u7684\u72b6\u6001\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sudo systemctl status mongod -l\r\n\u25cf mongod.service - MongoDB Database Server\r\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/mongod.service; enabled; vendor preset: disabled)\r\n   Active: active (running) since Tue 2022-01-18 19:10:35 JST; 6min ago\r\n     Docs: https:\/\/docs.mongodb.org\/manual\r\n Main PID: 13505 (mongod)\r\n   CGroup: \/system.slice\/mongod.service\r\n           \u2514\u250013505 \/usr\/bin\/mongod -f \/etc\/mongod.conf\r\n\r\nJan 18 19:10:34 work systemd[1]: Starting MongoDB Database Server...\r\nJan 18 19:10:34 work mongod[13501]: about to fork child process, waiting until server is ready for connections.\r\nJan 18 19:10:34 work mongod[13501]: forked process: 13505\r\nJan 18 19:10:35 work systemd[1]: Started MongoDB Database Server.\r\n[opc@work ~]$\r\n<\/code><\/pre>\n<p>\u5c06MongoDB\u8bbe\u7f6e\u4e3a\u81ea\u52a8\u542f\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sudo systemctl enable mongod\r\n<\/code><\/pre>\n<p>\u4f7f\u7528MongoDB Shell\uff08mongosh\uff09\u8fde\u63a5\u5230\u672c\u5730MongoDB\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ mongosh\r\nCurrent Mongosh Log ID:\t61ea4fa3e9f03bc6f1b4a89a\r\nConnecting to:\t\tmongodb:\/\/127.0.0.1:27017\/?directConnection=true&amp;serverSelectionTimeoutMS=2000&amp;appName=mongosh+1.1.9\r\nUsing MongoDB:\t\t5.0.5\r\nUsing Mongosh:\t\t1.1.9\r\n\r\nFor mongosh info see: https:\/\/docs.mongodb.com\/mongodb-shell\/\r\n\r\n\r\nTo help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https:\/\/www.mongodb.com\/legal\/privacy-policy).\r\nYou can opt-out by running the disableTelemetry() command.\r\n\r\n------\r\n   The server generated these startup warnings when booting:\r\n   2022-01-21T06:15:38.931+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted\r\n   2022-01-21T06:15:38.931+00:00: \/sys\/kernel\/mm\/transparent_hugepage\/enabled is 'always'. We suggest setting it to 'never'\r\n------\r\n\r\ntest&gt;\r\n<\/code><\/pre>\n<p>\u8fde\u63a5\u5230\u6570\u636e\u5e93\u7ba1\u7406\u5458\u3002<\/p>\n<pre class=\"post-pre\"><code>test&gt; use admin\r\nswitched to db admin\r\nadmin&gt; \r\n<\/code><\/pre>\n<p>\u521b\u5efa\u7ba1\u7406\u8005\u7528\u6237admin\uff08\u5bc6\u7801\uff1aDemo#1Demo#1\uff09\uff0c\u5e76\u6388\u4e88root\u89d2\u8272\u3002<\/p>\n<pre class=\"post-pre\"><code>admin&gt; db.createUser({user:\"admin\", pwd:\"Demo#1Demo#1\", roles:[{role:\"root\", db:\"admin\"}]})\r\n{ ok: 1 }\r\nadmin&gt;\r\n<\/code><\/pre>\n<p>\u68c0\u67e5\u5df2\u521b\u5efa\u7684\u7528\u6237\u3002<\/p>\n<pre class=\"post-pre\"><code>admin&gt; db.getUsers()\r\n{\r\n  users: [\r\n    {\r\n      _id: 'admin.admin',\r\n      userId: UUID(\"63aef149-23ed-4084-99b6-0ebe25572a3a\"),\r\n      user: 'admin',\r\n      db: 'admin',\r\n      roles: [ { role: 'root', db: 'admin' } ],\r\n      mechanisms: [ 'SCRAM-SHA-1', 'SCRAM-SHA-256' ]\r\n    }\r\n  ],\r\n  ok: 1\r\n}\r\nadmin&gt;\r\n<\/code><\/pre>\n<p>\u5173\u95edMongoDB Shell\u3002<\/p>\n<pre class=\"post-pre\"><code>admin&gt; exit\r\n[opc@work ~]$\r\n<\/code><\/pre>\n<p>\u505c\u6b62 MongoDB\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sudo systemctl stop mongod\r\n[opc@work ~]$\r\n<\/code><\/pre>\n<p>\u6253\u5f00MongoDB\u7684\u914d\u7f6e\u6587\u4ef6\/etc\/mongod.conf\uff0c\u5e76\u542f\u7528\u7528\u6237\u8ba4\u8bc1\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sudo vi \/etc\/mongod.conf\r\n<\/code><\/pre>\n<p>\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code>security:\r\n  authorization: enabled\r\n<\/code><\/pre>\n<p>\u542f\u52a8MongoDB\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sudo systemctl start mongod\r\n[opc@work ~]$ \r\n<\/code><\/pre>\n<h1>3. MongoDB\u7684\u64cd\u4f5c<br \/>\n\u4f7f\u7528MongoDB Shell\uff0c\u4f7f\u7528admin\u7528\u6237\u8fde\u63a5\u5230\u672c\u5730\u7684MongoDB\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ mongosh -u admin -p Demo#1Demo#1 \r\nCurrent Mongosh Log ID:\t61e7c76c26caf16738d30340\r\nConnecting to:\t\tmongodb:\/\/127.0.0.1:27017\/?directConnection=true&amp;serverSelectionTimeoutMS=2000\r\nUsing MongoDB:\t\t5.0.5\r\nUsing Mongosh:\t\t1.1.8\r\n\r\nFor mongosh info see: https:\/\/docs.mongodb.com\/mongodb-shell\/\r\n\r\n------\r\n   The server generated these startup warnings when booting:\r\n   2022-01-19T00:31:08.448+09:00: \/sys\/kernel\/mm\/transparent_hugepage\/enabled is 'always'. We suggest setting it to 'never'\r\n------\r\n\r\ntest&gt;\r\n<\/code><\/pre>\n<p>\u6211\u5c06\u67e5\u770b\u6570\u636e\u5e93\u7684\u5217\u8868\u3002<\/p>\n<pre class=\"post-pre\"><code>test&gt; show dbs\r\nadmin    209 kB\r\nconfig  61.4 kB\r\nlocal   73.7 kB\r\ntest&gt;\r\n<\/code><\/pre>\n<p>\u4f7f\u7528&#8221;\u30b3\u30de\u30f3\u30c9&#8221;\u6765\u521b\u5efa\u6570\u636e\u5e93\uff0c\u5e76\u8fde\u63a5\u5230\u6570\u636e\u5e93 &#8220;mongo&#8221;\u3002<\/p>\n<pre class=\"post-pre\"><code>test&gt; use mongo\r\nswitched to db mongo\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u6211\u8981\u521b\u5efa\u4e00\u4e2a&#8221;Collection&#8221; \u90e8\u95e8\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.createCollection('dept')\r\n{ ok: 1 }\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u4f7f\u7528insertOne()\u65b9\u6cd5\u521b\u5efadept\u96c6\u5408\uff0c\u5e76\u6dfb\u52a0JSON\u6587\u6863\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.dept.insertOne({\"deptno\":10,\"deptname\":\"ACCOUNTING\",\"location\":\"NEW YORK\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e7c80d8845e822d33dab38\")\r\n}\r\nmongo&gt; db.dept.insertOne({\"deptno\":20,\"deptname\":\"RESEARCH\",\"location\":\"DALLAS\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e7c8128845e822d33dab39\")\r\n}\r\nmongo&gt; db.dept.insertOne({\"deptno\":30,\"deptname\":\"SALES\",\"location\":\"CHICAGO\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e7c8158845e822d33dab3a\")\r\n}\r\nmongo&gt; db.dept.insertOne({\"deptno\":40,\"deptname\":\"OPERATIONS\",\"location\":\"BOSTON\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e7c8198845e822d33dab3b\")\r\n}\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u6211\u5c06\u786e\u8ba4Collection\u90e8\u95e8\u7684\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.dept.find()\r\n[\r\n  {\r\n    _id: ObjectId(\"61e7c80d8845e822d33dab38\"),\r\n    deptno: 10,\r\n    deptname: 'ACCOUNTING',\r\n    location: 'NEW YORK'\r\n  },\r\n  {\r\n    _id: ObjectId(\"61e7c8128845e822d33dab39\"),\r\n    deptno: 20,\r\n    deptname: 'RESEARCH',\r\n    location: 'DALLAS'\r\n  },\r\n  {\r\n    _id: ObjectId(\"61e7c8158845e822d33dab3a\"),\r\n    deptno: 30,\r\n    deptname: 'SALES',\r\n    location: 'CHICAGO'\r\n  },\r\n  {\r\n    _id: ObjectId(\"61e7c8198845e822d33dab3b\"),\r\n    deptno: 40,\r\n    deptname: 'OPERATIONS',\r\n    location: 'BOSTON'\r\n  }\r\n]\r\nmongo&gt; \r\n<\/code><\/pre>\n<p>\u8ba9\u6211\u4eec\u6307\u5b9a\u641c\u7d22\u6761\u4ef6\uff0c\u63d0\u53d6deptno\u4e3a10\u7684JSON\u6570\u636e\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.dept.find({\"deptno\": 10})\r\n[\r\n  {\r\n    _id: ObjectId(\"61e7c80d8845e822d33dab38\"),\r\n    deptno: 10,\r\n    deptname: 'ACCOUNTING',\r\n    location: 'NEW YORK'\r\n  }\r\n]\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u6211\u5011\u5c07\u5617\u8a66\u5f9edeptname\u70baSALES\u7684JSON\u6578\u64da\u4e2d\u63d0\u53d6\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.dept.find({\"deptname\": \"SALES\"})\r\n[\r\n  {\r\n    _id: ObjectId(\"61e7c8158845e822d33dab3a\"),\r\n    deptno: 30,\r\n    deptname: 'SALES',\r\n    location: 'CHICAGO'\r\n  }\r\n]\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u7ed3\u675fMongoDB Shell\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; exit\r\n<\/code><\/pre>\n<h1>4. \u521b\u5efa\u81ea\u4e3bJSON\u6570\u636e\u5e93 JSON de\u5728MongoDB Shell\u4e2d\u521b\u5efa\u8bbf\u95eeAutonomous JSON\u6570\u636e\u5e93\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d011d37434c4406bcd69a\/56-14.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2022-01-19 9.57.45.png\" \/><\/p>\n<h1>\u521b\u5efaMongoDB\u5ba2\u6237\u7aef\u8bbf\u95ee\u7528\u6237\u5e76\u5206\u914d\u89d2\u8272\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d011d37434c4406bcd69a\/58-13.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2022-01-20 8.54.28.png\" \/><\/p>\n<h1>6. \u81ea\u4e3bJSON\u6570\u636e\u5e93\u7684\u7f51\u7edc\u8bbf\u95ee\u66f4\u6539\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d011d37434c4406bcd69a\/60-4.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2022-01-20 9.08.27.png\" \/><\/p>\n<h1>\u83b7\u53d6Oracle\u6570\u636e\u5e93API for MongoDB\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d011d37434c4406bcd69a\/62-3.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2022-01-20 9.16.09.png\" \/>\u8fde\u63a5\u5b57\u7b26\u4e32\u7684\u683c\u5f0f\u5982\u4e0b\u3002<\/p>\n<p>\u5982\u679c\u662f\u65b0\u7684MongoDB\u5ba2\u6237\u7aef\/\u9a71\u52a8\u7a0b\u5e8f\u60c5\u51b5\u4e0b<\/p>\n<pre class=\"post-pre\"><code>mongodb:\/\/[user:password@]XXXXXXXXXX.adb.&lt;region&gt;.oraclecloudapps.com:27017\/[user]?authMechanism=PLAIN&amp;authSource=$external&amp;ssl=true&amp;retryWrites=false&amp;loadBalanced=true\r\n<\/code><\/pre>\n<p>\u9664\u6b64\u4e4b\u5916<\/p>\n<pre class=\"post-pre\"><code>mongodb:\/\/[user:password@]XXXXXXXXXX.adb.&lt;region&gt;.oraclecloudapps.com:27016\/[user]?authMechanism=PLAIN&amp;authSource=$external&amp;ssl=true&amp;retryWrites=false\r\n<\/code><\/pre>\n<h1>8. \u901a\u8fc7MongoDB Shell\u8bbf\u95ee\u81ea\u4e3bJSON\u6570\u636e\u5e93\u3002<br \/>\n\u56e0\u4e3a\u51c6\u5907\u5de5\u4f5c\u5df2\u7ecf\u5b8c\u6210\uff0c\u6240\u4ee5\u6211\u5c06\u5c1d\u8bd5\u4eceMongoDB Shell\u8fde\u63a5\u5230Autonomous JSON Database\u3002<br \/>\n\u6211\u5c06\u628a\u521a\u521a\u590d\u5236\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u7528\u6237user\u66ff\u6362\u4e3a\u521a\u521a\u521b\u5efa\u7684\u7528\u6237&#8221;mongo&#8221;\uff0c\u5e76\u5c06\u5bc6\u7801\u66ff\u6362\u4e3amongo\u7528\u6237\u7684\u5bc6\u7801\u8fdb\u884c\u4f7f\u7528\u3002<br \/>\n\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u5bc6\u7801\u4e2d\u5305\u542b\u4ee5\u4e0b\u5b57\u7b26\uff0c\u5219\u9700\u8981\u8fdb\u884c\u767e\u5206\u6bd4\u7f16\u7801\u3002<\/p>\n<pre class=\"post-pre\"><code>: \/ ? # [ ] @\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>[opc@work ~]$ mongosh 'mongodb:\/\/mongo:Demo%231Demo%231@XXXXXXXXXX.adb.ap-tokyo-1.oraclecloudapps.com:27017\/mongo?authMechanism=PLAIN&amp;authSource=$external&amp;ssl=true&amp;retryWrites=false&amp;loadBalanced=true'\r\nCurrent Mongosh Log ID:\t61e8ab854e5e3b975b80c535\r\nConnecting to:\t\tmongodb:\/\/&lt;credentials&gt;@XXXXXXXXXX.adb.ap-tokyo-1.oraclecloudapps.com:27017\/mongo?authMechanism=PLAIN&amp;authSource=$external&amp;ssl=true&amp;retryWrites=false&amp;loadBalanced=true\r\nUsing MongoDB:\t\t4.2.14\r\nUsing Mongosh:\t\t1.1.8\r\n\r\nFor mongosh info see: https:\/\/docs.mongodb.com\/mongodb-shell\/\r\n\r\nmongo&gt; \r\n<\/code><\/pre>\n<p>\u6211\u6210\u529f\u5730\u4f7f\u7528MongoDB Shell\u8fde\u63a5\u5230\u4e86Autonomous JSON Database\u3002<\/p>\n<p>\u6211\u4f1a\u5c1d\u8bd5\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u5bf9MongoDB\u6267\u884c\u4e4b\u524d\u7684\u64cd\u4f5c\u3002<\/p>\n<p>\u6211\u8981\u521b\u5efa\u4e00\u4e2a\u6536\u85cf\u7684\u90e8\u95e8\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.createCollection('dept')\r\n{ ok: 1 }\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u90e8\u95e8\u6536\u85cf\u5df2\u521b\u5efa\u3002<br \/>\n\u5c06\u68c0\u67e5\u5df2\u521b\u5efa\u7684\u6536\u85cf\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; show collections\r\ndept\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u5c06JSON\u6570\u636e\u6dfb\u52a0\u5230\u201c\u90e8\u95e8\u6536\u85cf\u5939\u201d\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.dept.insertOne({\"deptno\":10,\"deptname\":\"ACCOUNTING\",\"location\":\"NEW YORK\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e8ac1472062cfd73e14ecf\")\r\n}\r\nmongo&gt; db.dept.insertOne({\"deptno\":20,\"deptname\":\"RESEARCH\",\"location\":\"DALLAS\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e8ac1b72062cfd73e14ed0\")\r\n}\r\nmongo&gt; db.dept.insertOne({\"deptno\":30,\"deptname\":\"SALES\",\"location\":\"CHICAGO\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e8ac2072062cfd73e14ed1\")\r\n}\r\nmongo&gt; db.dept.insertOne({\"deptno\":40,\"deptname\":\"OPERATIONS\",\"location\":\"BOSTON\"})\r\n{\r\n  acknowledged: true,\r\n  insertedId: ObjectId(\"61e8ac2572062cfd73e14ed2\")\r\n}\r\nmongo&gt; \r\n<\/code><\/pre>\n<p>\u6211\u4f1a\u786e\u8ba4Collection\u90e8\u95e8\u7684\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.dept.find()\r\n[\r\n  {\r\n    _id: ObjectId(\"61e8ac1472062cfd73e14ecf\"),\r\n    deptno: 10,\r\n    deptname: 'ACCOUNTING',\r\n    location: 'NEW YORK'\r\n  },\r\n  {\r\n    _id: ObjectId(\"61e8ac1b72062cfd73e14ed0\"),\r\n    deptno: 20,\r\n    deptname: 'RESEARCH',\r\n    location: 'DALLAS'\r\n  },\r\n  {\r\n    _id: ObjectId(\"61e8ac2072062cfd73e14ed1\"),\r\n    deptno: 30,\r\n    deptname: 'SALES',\r\n    location: 'CHICAGO'\r\n  },\r\n  {\r\n    _id: ObjectId(\"61e8ac2572062cfd73e14ed2\"),\r\n    deptno: 40,\r\n    deptname: 'OPERATIONS',\r\n    location: 'BOSTON'\r\n  }\r\n]\r\nmongo&gt;\r\n<\/code><\/pre>\n<p>\u6211\u5c06\u4eceCollection\u90e8\u95e8\u4e2d\u6839\u636e\u6307\u5b9a\u6761\u4ef6\u63d0\u53d6JSON\u6570\u636e\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; db.dept.find({\"deptno\": 10})\r\n[\r\n  {\r\n    _id: ObjectId(\"61e8ac1472062cfd73e14ecf\"),\r\n    deptno: 10,\r\n    deptname: 'ACCOUNTING',\r\n    location: 'NEW YORK'\r\n  }\r\n]\r\nmongo&gt; db.dept.find({\"deptname\": \"SALES\"})\r\n[\r\n  {\r\n    _id: ObjectId(\"61e8ac2072062cfd73e14ed1\"),\r\n    deptno: 30,\r\n    deptname: 'SALES',\r\n    location: 'CHICAGO'\r\n  }\r\n]\r\nmongo&gt; \r\n<\/code><\/pre>\n<p>\u6211\u786e\u8ba4\u53ef\u4ee5\u5bf9MongoDB\u6267\u884c\u7684\u64cd\u4f5c\u4e5f\u53ef\u4ee5\u5bf9\u81ea\u4e3bJSON\u6570\u636e\u5e93\u6267\u884c\u3002<\/p>\n<p>\u5173\u95edMongoDB Shell\u3002<\/p>\n<pre class=\"post-pre\"><code>mongo&gt; exit\r\n<\/code><\/pre>\n<h1>\u7528SQL*Plus\u8fdb\u884c\u786e\u8ba4\u6211\u5c06\u4f7f\u7528SQL*Plus\u8fde\u63a5\u5230Autonomous JSON Database\uff0c\u5e76\u4e14\u4eceMongoDB Shell\u4e2d\u67e5\u770b\u6211\u521b\u5efa\u7684dept\u96c6\u5408\u7684\u5916\u89c2\u3002<\/p>\n<pre class=\"post-pre\"><code>[opc@work ~]$ sqlplus mongo\/Demo#1Demo#1@ajd1_medium\r\n\r\nSQL*Plus: Release 19.0.0.0.0 - Production on \u6728 1\u6708 20 09:31:30 2022\r\nVersion 19.11.0.0.0\r\n\r\nCopyright (c) 1982, 2020, Oracle.  All rights reserved.\r\n\r\n\u6700\u7d42\u6b63\u5e38\u30ed\u30b0\u30a4\u30f3\u6642\u9593: \u6728 1\u6708  20 2022 09:30:36 +09:00\r\n\r\n\r\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\r\nVersion 19.14.0.1.0\r\n\u306b\u63a5\u7d9a\u3055\u308c\u307e\u3057\u305f\u3002\r\n<\/code><\/pre>\n<p>\u6211\u4f1a\u67e5\u770b\u4e00\u4e0b\u684c\u5b50\u3002<\/p>\n<pre class=\"post-pre\"><code>SQL&gt; col tname for a20\r\nSQL&gt; SELECT tname FROM tab;\r\n\r\nTNAME\r\n--------------------\r\nDEPT\r\n<\/code><\/pre>\n<p>\u4f7f\u7528Mongo Sell\u521b\u5efa\u7684\u96c6\u5408dept\u88ab\u4f5c\u4e3a\u4e00\u5f20\u8868\u521b\u5efa\u4e86\u3002<\/p>\n<p>\u6211\u5011\u4f86\u67e5\u770b\u4e00\u4e0bdept\u8868\u7684\u7d50\u69cb\u3002<\/p>\n<pre class=\"post-pre\"><code>SQL&gt; desc dept\r\n \u540d\u524d                                    NULL?    \u578b\r\n ----------------------------------------- -------- ----------------------------\r\n ID\t\t\t\t\t   NOT NULL VARCHAR2(255)\r\n CREATED_ON\t\t\t\t   NOT NULL TIMESTAMP(6)\r\n LAST_MODIFIED\t\t\t\t   NOT NULL TIMESTAMP(6)\r\n VERSION\t\t\t\t   NOT NULL VARCHAR2(255)\r\n JSON_DOCUMENT\t\t\t\t\t    BLOB\r\n<\/code><\/pre>\n<p>\u90e8\u95e8\u8868\u5305\u62ecID\u3001\u521b\u5efa\u65f6\u95f4\u3001\u6700\u540e\u4fee\u6539\u65f6\u95f4\u3001\u7248\u672c\u548cJSON\u6587\u6863\u8fd9\u4e94\u4e2a\u5217\u3002<\/p>\n<p>\u4f7f\u7528Mongo Shell\u63d2\u5165\u7684JSON\u6570\u636e\u4f3c\u4e4e\u5b58\u50a8\u5728BLOB\u7c7b\u578b\u7684JSON_DOCUMENT\u4e2d\u3002<br \/>\n\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528JSON_SERIALIZE\u6765\u67e5\u770b\u5b58\u50a8\u7684JSON\u6570\u636e\u3002<\/p>\n<pre class=\"post-pre\"><code>SQL&gt; set linesize 200\r\nSQL&gt; SELECT JSON_SERIALIZE(json_document) FROM dept;    \r\n\r\nJSON_SERIALIZE(JSON_DOCUMENT)\r\n--------------------------------------------------------------------------------\r\n{\"deptno\":10,\"deptname\":\"ACCOUNTING\",\"location\":\"NEW YORK\",\"_id\":\"61e8ac1472062cfd73e14ecf\"}\r\n{\"deptno\":20,\"deptname\":\"RESEARCH\",\"location\":\"DALLAS\",\"_id\":\"61e8ac1b72062cfd73e14ed0\"}\r\n{\"deptno\":30,\"deptname\":\"SALES\",\"location\":\"CHICAGO\",\"_id\":\"61e8ac2072062cfd73e14ed1\"}\r\n{\"deptno\":40,\"deptname\":\"OPERATIONS\",\"location\":\"BOSTON\",\"_id\":\"61e8ac2572062cfd73e14ed2\"}\r\n\r\nSQL&gt; \r\n<\/code><\/pre>\n<p>\u6211\u786e\u8ba4\u5728MongoDB Shell\u4e2d\u63d2\u5165\u7684JSON\u6570\u636e\u5df2\u7ecf\u5b58\u50a8\u5728json_document\u5217\u4e2d\u3002<\/p>\n<h1>\u8bf7\u63d0\u4f9b\u4e00\u4e9b\u53c2\u8003\u8d44\u6599\u3002Oracle\u5e2e\u52a9\u4e2d\u5fc3\uff1aOracle Database API for MongoDB<br \/>\nOracle\u5e2e\u52a9\u4e2d\u5fc3\uff1a\u4f7f\u7528Oracle Database API for MongoDB<br \/>\nOracle\u6570\u636e\u5e93\u5185\u5e55\u4eba\u58eb\uff1aOracle Database API for MongoDB<br \/>\nMongoDB\u6587\u6863\uff1a\u8fde\u63a5\u5b57\u7b26\u4e32\u95ee\u9898<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u901a\u8fc7\u4f7f\u7528Oracle Database API for MongoDB\uff0c\u5728MongoDB\u5ba2\u6237\u7aef\u548c\u9a71\u52a8\u7a0b\u5e8f\u4e2d [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-29299","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u5c1d\u8bd5\u4eceocimongodb\u5ba2\u6237\u7aef\u8fde\u63a5\u5230autonomous-json\u6570\u636e\u5e93\uff08\u4f7f\u7528mongodb-shell\uff09\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u5c1d\u8bd5\u4eceocimongodb\u5ba2\u6237\u7aef\u8fde\u63a5\u5230autonomous-json\u6570\u636e\u5e93\uff08\u4f7f\u7528mongodb-shell\uff09\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-10T01:17:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T05:24:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d011d37434c4406bcd69a\/56-14.png\" \/>\n<meta name=\"author\" content=\"\u6e05, \u626c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u626c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/\",\"name\":\"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-08-10T01:17:49+00:00\",\"dateModified\":\"2025-08-12T05:24:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"description\":\"\u5173\u4e8e\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\",\"name\":\"\u6e05, \u626c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u626c\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u5c1d\u8bd5\u4eceocimongodb\u5ba2\u6237\u7aef\u8fde\u63a5\u5230autonomous-json\u6570\u636e\u5e93\uff08\u4f7f\u7528mongodb-shell\uff09\/","og_locale":"zh_CN","og_type":"article","og_title":"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09","og_description":"\u5173\u4e8e\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u5c1d\u8bd5\u4eceocimongodb\u5ba2\u6237\u7aef\u8fde\u63a5\u5230autonomous-json\u6570\u636e\u5e93\uff08\u4f7f\u7528mongodb-shell\uff09\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-10T01:17:49+00:00","article_modified_time":"2025-08-12T05:24:43+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d011d37434c4406bcd69a\/56-14.png"}],"author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/","name":"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-08-10T01:17:49+00:00","dateModified":"2025-08-12T05:24:43+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"description":"\u5173\u4e8e\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u6211\u5c1d\u8bd5\u4ece[OCI]MongoDB\u5ba2\u6237\u7aef\u8fde\u63a5\u5230Autonomous JSON\u6570\u636e\u5e93\uff08\u4f7f\u7528MongoDB Shell\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461","name":"\u6e05, \u626c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","caption":"\u6e05, \u626c"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%b0%9d%e8%af%95%e4%bb%8eocimongodb%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%88%b0autonomous-json%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e4%bd%bf%e7%94%a8mongodb-shell%ef%bc%89\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=29299"}],"version-history":[{"count":3,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29299\/revisions"}],"predecessor-version":[{"id":111446,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29299\/revisions\/111446"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=29299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=29299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=29299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}