|
@@ -28,11 +28,12 @@ const fingerPrintSchema = new Schema({
|
|
|
|
|
|
const messageSchema = require('../dependencies/log/type/schemas/message.schema')
|
|
|
|
|
|
+
|
|
|
+
|
|
|
function convertDataInMongo(url: string) {
|
|
|
-
|
|
|
+
|
|
|
let data: Subject<any> = new Subject()
|
|
|
let convertService = new LoggingService()
|
|
|
-
|
|
|
let dbConnection = mongoose.createConnection(url)
|
|
|
let dataModel = dbConnection.model('genericdata', fingerPrintSchema)
|
|
|
let messages = dbConnection.model('message', messageSchema)
|
|
@@ -55,9 +56,12 @@ function convertDataInMongo(url: string) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-let dbConnection = mongoose.createConnection("mongodb+srv://testDB:h1nt1OyXw6QeUnzS@cluster0.29sklte.mongodb.net/secondary")
|
|
|
-let dataModel = dbConnection.model('genericdata', fingerPrintSchema)
|
|
|
|
|
|
+
|
|
|
+const dbConnection = mongoose.createConnection("mongodb+srv://testDB:h1nt1OyXw6QeUnzS@cluster0.29sklte.mongodb.net/secondary")
|
|
|
+const dataModel = dbConnection.model('genericdata', fingerPrintSchema)
|
|
|
+
|
|
|
+
|
|
|
function convertMessageLogToCDMS(args: MessageLog){
|
|
|
let converted = secondary_log.convertMessageLogtoCDMS(args)
|
|
|
dataModel.create(converted)
|
|
@@ -204,8 +208,8 @@ function countdown() {
|
|
|
|
|
|
countdown()
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+convertDataInMongo('mongodb://192.168.100.59:27017/primary')
|
|
|
+convertDataInMongo('mongodb+srv://testDB:h1nt1OyXw6QeUnzS@cluster0.29sklte.mongodb.net/secondary')
|
|
|
|
|
|
|
|
|
secondary_log.init(settings.target).then(() => {
|