Browse Source

新增MongoDB数据导出脚本程序

chenhao 2 years ago
parent
commit
543444b0e5
1 changed files with 6 additions and 1 deletions
  1. 6 1
      mongoDataExportScript.py

+ 6 - 1
mongoDataExportScript.py

@@ -1,3 +1,8 @@
+# @Time:2018-10-20
+# @Author:chenhao
+# @File:mongoDataExportScript.py
+
+
 """
 本脚本文件主要用于 MongoDB 数据导出
 
@@ -63,7 +68,7 @@ def range_search(start_timestamp, end_timestamp,ip,Uname,passwd,DB,Table):
     
     return: DataFrame
     """
-    con = pymongo.MongoClient(ip,username=Uname,password=passwd)
+    con = pymongo.MongoClient(ip)
     with con:
         db = con[DB]
         tableData = db[Table]