private async Task PopulateCategory(CancellationToken cancellationToken)
        {
            _logger?.LogDebug("Populating Category in existing events...");

            var fb = Builders <RecordedEventDocument> .Filter;

            var cursor = await _events
                         .Find(fb.Not(fb.Exists(e => e.Category)))
                         .ToCursorAsync(cancellationToken);

            var batch = new List <WriteModel <RecordedEventDocument> >();

            while (await cursor.MoveNextAsync(cancellationToken))
            {
                batch.Clear();

                foreach (var document in cursor.Current)
                {
                    var category = _streamNameResolver.AggregateName(document.Stream);

                    var definition = new UpdateOneModel <RecordedEventDocument>(
                        Builders <RecordedEventDocument> .Filter.Where(e => e.Id == document.Id),
                        Builders <RecordedEventDocument> .Update.Set(e => e.Category, category)
                        );

                    batch.Add(definition);
                }

                if (batch.Count > 0)
                {
                    await _events.BulkWriteAsync(batch, null, cancellationToken);
                }
            }
        }