diff --git a/src/lib60870.netcore/iec101server/MongoChangeStream.cs b/src/lib60870.netcore/iec101server/MongoChangeStream.cs index 3d434f24..f804f9f3 100644 --- a/src/lib60870.netcore/iec101server/MongoChangeStream.cs +++ b/src/lib60870.netcore/iec101server/MongoChangeStream.cs @@ -108,8 +108,8 @@ static async void ProcessMongoCS(JSONSCADAConfig jsConfig) throw new Exception("Error on connection " + jsConfig.mongoConnectionString); Log("MongoDB CMD CS - Start listening for realtime data updates via changestream..."); - // observe updates and replaces, avoid updates with sourceDataUpdateField (those are handled by cs_data_processor.js) - var filter = "{ $or: [{ $and:[{ 'updateDescription.updatedFields.sourceDataUpdate': { $exists: false } },{ operationType: 'update' }] }, { operationType: 'replace'}] }"; + // observe updates and replaces, avoid updates with sourceDataUpdateField (those are handled by cs_data_processor.js), require protocolDestinations not null + var filter = "{ $or: [{ $and:[{ 'fullDocument.protocolDestinations': { $ne: null } },{ 'updateDescription.updatedFields.sourceDataUpdate': { $exists: false } },{ operationType: 'update' }] }, { operationType: 'replace'}] }"; var pipeline = new EmptyPipelineDefinition