format code
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
from pymongo import MongoClient
|
||||
|
||||
import json
|
||||
|
||||
# 连接到 MongoDB
|
||||
client = MongoClient('mongodb://root:lostecho@192.168.31.3:27017/')
|
||||
# 选择数据库
|
||||
@@ -32,6 +33,7 @@ def insert_course_content(file_path):
|
||||
except Exception as e:
|
||||
print(f"错误:处理文件 {file_path} 时出现未知错误:{e}")
|
||||
|
||||
|
||||
def get_course_content(id_to_query):
|
||||
try:
|
||||
|
||||
@@ -53,4 +55,4 @@ def get_course_content(id_to_query):
|
||||
else:
|
||||
print(f"未找到 _id 为 {id_to_query} 的文档。")
|
||||
except Exception as e:
|
||||
print(f"错误:查询或处理数据时出现未知错误:{e}")
|
||||
print(f"错误:查询或处理数据时出现未知错误:{e}")
|
||||
|
||||
Reference in New Issue
Block a user