/// <inheritdoc />
        public void Set(EventProcessorId eventProcessorId, CommittedEventVersion committedEventVersion)
        {
            var versionBson = committedEventVersion.AsBson();

            versionBson.Add(Constants.ID, eventProcessorId.Value);
            _offsets.ReplaceOne(eventProcessorId.ToFilter(), versionBson, new UpdateOptions {
                IsUpsert = true
            });
        }
        /// <inheritdoc />
        public CommittedEventVersion Get(EventProcessorId eventProcessorId)
        {
            var version = _offsets.Find(eventProcessorId.ToFilter()).SingleOrDefault();

            if (version == null)
            {
                return(CommittedEventVersion.None);
            }

            return(version.ToCommittedEventVersion());
        }