{"id":2890,"date":"2025-03-16T13:01:46","date_gmt":"2025-03-16T05:01:46","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=2890"},"modified":"2025-03-16T13:01:46","modified_gmt":"2025-03-16T05:01:46","slug":"python-mongodb","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/03\/16\/python-mongodb\/","title":{"rendered":"Python MongoDB"},"content":{"rendered":"\n<p>\u5728 Python \u4e2d\u4f7f\u7528 MongoDB\uff0c\u53ef\u4ee5\u901a\u8fc7 <code>pymongo<\/code> \u5e93\u6765\u4e0e MongoDB \u8fdb\u884c\u4ea4\u4e92\u3002<code>pymongo<\/code> \u662f MongoDB \u7684\u5b98\u65b9 Python \u9a71\u52a8\u7a0b\u5e8f\uff0c\u5141\u8bb8\u4f60\u901a\u8fc7 Python \u64cd\u4f5c MongoDB \u6570\u636e\u5e93\uff0c\u5305\u62ec\u63d2\u5165\u3001\u67e5\u8be2\u3001\u66f4\u65b0\u548c\u5220\u9664\u6587\u6863\u7b49\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u5c06\u8be6\u7ec6\u89e3\u6790\u5982\u4f55\u5728 Python \u4e2d\u4f7f\u7528 MongoDB\uff0c\u5305\u62ec\u5b89\u88c5\u3001\u57fa\u672c\u64cd\u4f5c\u548c\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. \u5b89\u88c5 PyMongo<\/strong><\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5 <code>pymongo<\/code> \u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install pymongo<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. \u8fde\u63a5\u5230 MongoDB<\/strong><\/h2>\n\n\n\n<p>\u8981\u8fde\u63a5\u5230 MongoDB \u6570\u636e\u5e93\uff0c\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2a MongoClient \u5bf9\u8c61\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cMongoDB \u5728\u672c\u5730\u8fd0\u884c\uff0c\u4f7f\u7528\u7aef\u53e3\u53f7 27017\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from pymongo import MongoClient\n\n# \u521b\u5efa MongoClient \u5bf9\u8c61\u5e76\u8fde\u63a5\u5230\u672c\u5730 MongoDB\nclient = MongoClient('mongodb:\/\/localhost:27017\/')\n\n# \u8fde\u63a5\u5230\u6307\u5b9a\u7684\u6570\u636e\u5e93\ndb = client&#91;'mydatabase']<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. \u6570\u636e\u5e93\u548c\u96c6\u5408<\/strong><\/h2>\n\n\n\n<p>\u5728 MongoDB \u4e2d\uff0c\u6570\u636e\u5b58\u50a8\u5728\u6570\u636e\u5e93\u5185\uff0c\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u4ee5\u96c6\u5408\u7684\u5f62\u5f0f\u5b58\u50a8\u3002\u6bcf\u4e2a\u96c6\u5408\u53ef\u4ee5\u5305\u542b\u591a\u4e2a\u6587\u6863\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.1 \u83b7\u53d6\u6570\u636e\u5e93<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u83b7\u53d6\u540d\u4e3a 'mydatabase' \u7684\u6570\u636e\u5e93\ndb = client&#91;'mydatabase']<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.2 \u83b7\u53d6\u96c6\u5408<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u83b7\u53d6\u540d\u4e3a 'mycollection' \u7684\u96c6\u5408\ncollection = db&#91;'mycollection']<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. \u63d2\u5165\u6587\u6863<\/strong><\/h2>\n\n\n\n<p>\u5728 MongoDB \u4e2d\uff0c\u6570\u636e\u4ee5\u6587\u6863\uff08\u7c7b\u4f3c\u4e8e JSON\uff09\u5f62\u5f0f\u5b58\u50a8\u3002\u63d2\u5165\u6587\u6863\u53ef\u4ee5\u4f7f\u7528 <code>insert_one()<\/code> \u6216 <code>insert_many()<\/code> \u65b9\u6cd5\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.1 \u63d2\u5165\u5355\u4e2a\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u63d2\u5165\u4e00\u4e2a\u6587\u6863\ndocument = {\"name\": \"Alice\", \"age\": 25, \"city\": \"New York\"}\ncollection.insert_one(document)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.2 \u63d2\u5165\u591a\u4e2a\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u63d2\u5165\u591a\u4e2a\u6587\u6863\ndocuments = &#91;\n    {\"name\": \"Bob\", \"age\": 30, \"city\": \"Los Angeles\"},\n    {\"name\": \"Charlie\", \"age\": 35, \"city\": \"Chicago\"}\n]\ncollection.insert_many(documents)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. \u67e5\u8be2\u6587\u6863<\/strong><\/h2>\n\n\n\n<p>MongoDB \u63d0\u4f9b\u4e86\u591a\u79cd\u67e5\u8be2\u65b9\u6cd5\uff0c\u6700\u5e38\u7528\u7684\u662f <code>find()<\/code> \u65b9\u6cd5\u3002\u53ef\u4ee5\u901a\u8fc7\u6761\u4ef6\u6765\u67e5\u8be2\u7b26\u5408\u6761\u4ef6\u7684\u6587\u6863\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.1 \u67e5\u8be2\u6240\u6709\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u8be2\u96c6\u5408\u4e2d\u7684\u6240\u6709\u6587\u6863\nfor document in collection.find():\n    print(document)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.2 \u67e5\u8be2\u5355\u4e2a\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u8be2\u7b2c\u4e00\u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u6587\u6863\ndocument = collection.find_one({\"name\": \"Alice\"})\nprint(document)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.3 \u6761\u4ef6\u67e5\u8be2<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u8be2\u5e74\u9f84\u5927\u4e8e30\u7684\u6587\u6863\nfor document in collection.find({\"age\": {\"$gt\": 30}}):\n    print(document)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.4 \u4f7f\u7528\u6295\u5f71\u67e5\u8be2<\/strong><\/h3>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u9650\u5236\u8fd4\u56de\u7684\u5b57\u6bb5\uff0c\u7c7b\u4f3c\u4e8e SQL \u4e2d\u7684 SELECT \u5b50\u53e5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u8be2\u6240\u6709\u6587\u6863\uff0c\u4f46\u53ea\u8fd4\u56de 'name' \u548c 'age' \u5b57\u6bb5\nfor document in collection.find({}, {\"_id\": 0, \"name\": 1, \"age\": 1}):\n    print(document)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.5 \u4f7f\u7528\u6392\u5e8f<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6309\u7167\u5e74\u9f84\u8fdb\u884c\u5347\u5e8f\u6392\u5e8f\nfor document in collection.find().sort(\"age\", 1):  # 1 \u8868\u793a\u5347\u5e8f\uff0c-1 \u8868\u793a\u964d\u5e8f\n    print(document)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>6. \u66f4\u65b0\u6587\u6863<\/strong><\/h2>\n\n\n\n<p>\u66f4\u65b0\u6587\u6863\u53ef\u4ee5\u4f7f\u7528 <code>update_one()<\/code>, <code>update_many()<\/code> \u6216 <code>replace_one()<\/code> \u65b9\u6cd5\u3002\u901a\u5e38\uff0c\u4f60\u4f1a\u6839\u636e\u67e5\u8be2\u6761\u4ef6\u6765\u627e\u5230\u9700\u8981\u66f4\u65b0\u7684\u6587\u6863\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.1 \u66f4\u65b0\u5355\u4e2a\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u66f4\u65b0\u7b26\u5408\u6761\u4ef6\u7684\u7b2c\u4e00\u4e2a\u6587\u6863\ncollection.update_one(\n    {\"name\": \"Alice\"},  # \u67e5\u8be2\u6761\u4ef6\n    {\"$set\": {\"age\": 26}}  # \u66f4\u65b0\u64cd\u4f5c\n)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.2 \u66f4\u65b0\u591a\u4e2a\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u66f4\u65b0\u6240\u6709\u7b26\u5408\u6761\u4ef6\u7684\u6587\u6863\ncollection.update_many(\n    {\"age\": {\"$lt\": 30}},  # \u67e5\u8be2\u6761\u4ef6\n    {\"$set\": {\"status\": \"young\"}}  # \u66f4\u65b0\u64cd\u4f5c\n)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.3 \u66ff\u6362\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u66ff\u6362\u7b26\u5408\u6761\u4ef6\u7684\u6587\u6863\ncollection.replace_one(\n    {\"name\": \"Alice\"},\n    {\"name\": \"Alice\", \"age\": 27, \"city\": \"San Francisco\"}\n)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>7. \u5220\u9664\u6587\u6863<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.1 \u5220\u9664\u5355\u4e2a\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5220\u9664\u7b26\u5408\u6761\u4ef6\u7684\u7b2c\u4e00\u4e2a\u6587\u6863\ncollection.delete_one({\"name\": \"Alice\"})<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.2 \u5220\u9664\u591a\u4e2a\u6587\u6863<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5220\u9664\u6240\u6709\u7b26\u5408\u6761\u4ef6\u7684\u6587\u6863\ncollection.delete_many({\"age\": {\"$lt\": 30}})<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.3 \u5220\u9664\u6574\u4e2a\u96c6\u5408<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5220\u9664\u6574\u4e2a\u96c6\u5408\ncollection.drop()<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>8. \u7d22\u5f15<\/strong><\/h2>\n\n\n\n<p>MongoDB \u63d0\u4f9b\u4e86\u7d22\u5f15\u673a\u5236\u6765\u52a0\u901f\u67e5\u8be2\u3002\u4f60\u53ef\u4ee5\u4e3a\u5e38\u7528\u7684\u67e5\u8be2\u5b57\u6bb5\u521b\u5efa\u7d22\u5f15\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8.1 \u521b\u5efa\u7d22\u5f15<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u4e3a 'name' \u5b57\u6bb5\u521b\u5efa\u7d22\u5f15\ncollection.create_index(&#91;(\"name\", 1)])  # 1 \u8868\u793a\u5347\u5e8f\uff0c-1 \u8868\u793a\u964d\u5e8f<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8.2 \u67e5\u8be2\u7d22\u5f15<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u8be2\u5f53\u524d\u96c6\u5408\u7684\u6240\u6709\u7d22\u5f15\nindexes = collection.list_indexes()\nfor index in indexes:\n    print(index)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>9. \u805a\u5408\u64cd\u4f5c<\/strong><\/h2>\n\n\n\n<p>MongoDB \u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u805a\u5408\u6846\u67b6\uff0c\u53ef\u4ee5\u901a\u8fc7 <code>aggregate()<\/code> \u65b9\u6cd5\u8fdb\u884c\u6570\u636e\u7684\u5206\u7ec4\u3001\u7b5b\u9009\u548c\u6392\u5e8f\u7b49\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9.1 \u7b80\u5355\u7684\u805a\u5408\u67e5\u8be2<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6309 'city' \u5b57\u6bb5\u5206\u7ec4\uff0c\u8ba1\u7b97\u6bcf\u4e2a\u57ce\u5e02\u7684\u5e73\u5747\u5e74\u9f84\npipeline = &#91;\n    {\"$group\": {\"_id\": \"$city\", \"average_age\": {\"$avg\": \"$age\"}}}\n]\nfor result in collection.aggregate(pipeline):\n    print(result)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9.2 \u805a\u5408\u7ba1\u9053<\/strong><\/h3>\n\n\n\n<p>\u805a\u5408\u7ba1\u9053\u5141\u8bb8\u4f60\u901a\u8fc7\u4e00\u7cfb\u5217\u7684\u64cd\u4f5c\u6b65\u9aa4\u5bf9\u6570\u636e\u8fdb\u884c\u53d8\u6362\u3002\u6bcf\u4e00\u6b65\u53ef\u4ee5\u5904\u7406\u6570\u636e\u5e76\u5c06\u7ed3\u679c\u4f20\u9012\u5230\u4e0b\u4e00\u6b65\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u4f7f\u7528\u7ba1\u9053\u8fdb\u884c\u66f4\u590d\u6742\u7684\u67e5\u8be2\npipeline = &#91;\n    {\"$match\": {\"age\": {\"$gte\": 30}}},  # \u8fc7\u6ee4\u5e74\u9f84\u5927\u4e8e\u7b49\u4e8e 30 \u7684\u6587\u6863\n    {\"$group\": {\"_id\": \"$city\", \"total\": {\"$sum\": 1}}},  # \u6309\u7167\u57ce\u5e02\u5206\u7ec4\u5e76\u7edf\u8ba1\u6570\u91cf\n    {\"$sort\": {\"total\": -1}}  # \u6309\u7167\u603b\u6570\u8fdb\u884c\u964d\u5e8f\u6392\u5e8f\n]\n\nfor result in collection.aggregate(pipeline):\n    print(result)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>10. \u8fde\u63a5\u6c60<\/strong><\/h2>\n\n\n\n<p>MongoDB \u4f7f\u7528\u8fde\u63a5\u6c60\u6765\u4f18\u5316\u6027\u80fd\uff0c\u907f\u514d\u6bcf\u6b21\u67e5\u8be2\u90fd\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u8fde\u63a5\u3002\u5728 PyMongo \u4e2d\uff0c\u8fde\u63a5\u6c60\u662f\u9ed8\u8ba4\u542f\u7528\u7684\uff0c\u4f60\u65e0\u9700\u7279\u522b\u914d\u7f6e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>11. \u4e8b\u52a1\uff08Multi-Document Transactions\uff09<\/strong><\/h2>\n\n\n\n<p>MongoDB \u5728 4.0 \u7248\u672c\u540e\u652f\u6301\u591a\u6587\u6863\u4e8b\u52a1\u3002\u901a\u8fc7 <code>pymongo<\/code> \u7684\u4e8b\u52a1\u652f\u6301\uff0c\u4f60\u53ef\u4ee5\u5728\u591a\u4e2a\u64cd\u4f5c\u4e4b\u95f4\u4fdd\u6301\u4e00\u81f4\u6027\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>with client.start_session() as session:\n    with session.start_transaction():\n        collection.update_one({\"name\": \"Alice\"}, {\"$set\": {\"age\": 28}}, session=session)\n        collection.update_one({\"name\": \"Bob\"}, {\"$set\": {\"age\": 31}}, session=session)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>12. \u9519\u8bef\u5904\u7406<\/strong><\/h2>\n\n\n\n<p>\u5728\u4e0e MongoDB \u8fdb\u884c\u4ea4\u4e92\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u7684\u9519\u8bef\uff0c\u4f8b\u5982\u8fde\u63a5\u9519\u8bef\u3001\u6587\u6863\u4e0d\u5b58\u5728\u7b49\u3002\u53ef\u4ee5\u4f7f\u7528 <code>try-except<\/code> \u8bed\u53e5\u6765\u6355\u83b7\u548c\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from pymongo.errors import ConnectionFailure, DuplicateKeyError\n\ntry:\n    client = MongoClient('mongodb:\/\/localhost:27017\/')\n    db = client&#91;'mydatabase']\n    collection = db&#91;'mycollection']\nexcept ConnectionFailure:\n    print(\"Could not connect to MongoDB\")<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<p>\u901a\u8fc7 <code>pymongo<\/code> \u5e93\uff0cPython \u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0e MongoDB \u8fdb\u884c\u4ea4\u4e92\u3002\u4f60\u53ef\u4ee5\u6267\u884c\u5e38\u89c1\u7684 CRUD\uff08\u521b\u5efa\u3001\u8bfb\u53d6\u3001\u66f4\u65b0\u3001\u5220\u9664\uff09\u64cd\u4f5c\uff0c\u8fd8\u80fd\u5229\u7528 MongoDB \u7684\u5f3a\u5927\u529f\u80fd\uff0c\u5982\u805a\u5408\u67e5\u8be2\u3001\u7d22\u5f15\u548c\u4e8b\u52a1\u7b49\u3002\u638c\u63e1\u8fd9\u4e9b\u57fa\u7840\u64cd\u4f5c\u540e\uff0c\u4f60\u5c31\u80fd\u9ad8\u6548\u5730\u5728 Python \u4e2d\u4f7f\u7528 MongoDB\u3002<\/p>\n\n\n\n<p>\u66f4\u591a\u8be6\u7ec6\u5185\u5bb9\u8bf7\u5173\u6ce8\u5176\u4ed6\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Python \u4e2d\u4f7f\u7528 MongoDB\uff0c\u53ef\u4ee5\u901a\u8fc7 pymongo \u5e93\u6765\u4e0e MongoDB \u8fdb\u884c\u4ea4\u4e92\u3002pymo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2891,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79],"tags":[],"class_list":["post-2890","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-3-"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=2890"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2890\/revisions"}],"predecessor-version":[{"id":2892,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2890\/revisions\/2892"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media\/2891"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=2890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=2890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=2890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}