File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
- # Send data to destination based on mongo.cfg file.
2
- # Version 0.04
1
+ # Class: sendDataMongoDB
2
+ # Last updated: 2022/07/17
3
+ # Author: TheScriptGuy (https://github.com/TheScriptGuy
4
+ # Version: 0.06
5
+ # Description: Send json list to mongoDB based on configuration in mongo.cfg
3
6
4
7
import pymongo
5
8
from pymongo import MongoClient
@@ -129,8 +132,8 @@ def uploadDataToMongoDB(self, __jsonScriptData):
129
132
# Convert the startTime and endTime fields info ISODate format.
130
133
jsonScriptData = __jsonScriptData
131
134
132
- jsonScriptData ["scriptStartTime" ] = datetime .fromisoformat (jsonScriptData ["scriptStartTime" ])
133
- jsonScriptData ["scriptEndTime" ] = datetime .fromisoformat (jsonScriptData ["scriptEndTime" ])
135
+ jsonScriptData ["queryStatistics" ][ " scriptStartTime" ] = datetime .fromisoformat (jsonScriptData [ "queryStatistics" ] ["scriptStartTime" ])
136
+ jsonScriptData ["queryStatistics" ][ " scriptEndTime" ] = datetime .fromisoformat (jsonScriptData [ "queryStatistics" ] ["scriptEndTime" ])
134
137
135
138
for iResult in jsonScriptData ["certResults" ]:
136
139
iResult ["startTime" ] = datetime .fromisoformat (iResult ["startTime" ])
@@ -145,4 +148,4 @@ def uploadDataToMongoDB(self, __jsonScriptData):
145
148
def __init__ (self ):
146
149
"""Initialize the sendDataMongoDB class."""
147
150
self .initialized = True
148
- self .version = "0.05 "
151
+ self .version = "0.06 "
You can’t perform that action at this time.
0 commit comments