SingleDocChange constructor

SingleDocChange(
  1. Map event
)

Implementation

SingleDocChange(Map event) {
  this.id = event['ID'] ?? -199;
  this.dataType = event['DataType'];
  this.queueType = event['QueueType'];
  this.docId = event['DocID'];

  if (event['Doc'] is String && event['Doc'] != '{}') {
    this.doc = JSON.jsonDecode(event['Doc']);
  }

  if (dataType == 'update') {
    if (event['UpdatedFields'] is String && event['UpdatedFields'] != '') {
      this.updatedFields = JSON.jsonDecode(event['UpdatedFields']);
    }
    if (event['removedFields'] is String && event['removedFields'] != '') {
      this.removedFields = JSON.jsonDecode(event['removedFields']);
    }
  }
}