public override BlittableJsonReaderObject GetUpdatedValue(JsonOperationContext context, BlittableJsonReaderObject previousValue, long index)
        {
            if (string.IsNullOrWhiteSpace(Value.Name))
            {
                Value.Name = GenerateTaskName(previousValue);
            }

            if (Value.ExcludedDatabases != null &&
                Value.ExcludedDatabases.Any(string.IsNullOrWhiteSpace))
            {
                throw new RachisApplyException($"{nameof(ServerWideExternalReplication.ExcludedDatabases)} cannot contain null or empty database names");
            }

            var originTaskId = Value.TaskId;

            Value.TaskId = index;

            if (previousValue != null)
            {
                var lazy = context.GetLazyString(Value.Name);
                if (previousValue.Contains(lazy) == false)
                {
                    //The name have might modified so we search by index/TaskId
                    foreach (var propertyName in previousValue.GetPropertyNames())
                    {
                        var value = previousValue[propertyName] as BlittableJsonReaderObject;
                        Debug.Assert(value != null);
                        if (value.TryGet(nameof(ServerWideExternalReplication.TaskId), out long taskId) && taskId == originTaskId)
                        {
                            previousValue.Modifications = new DynamicJsonValue(previousValue);
                            previousValue.Modifications.Remove(propertyName);
                            break;
                        }
                    }
                }
                previousValue.Modifications ??= new DynamicJsonValue();
                previousValue.Modifications[Value.Name] = Value.ToJson();

                return(context.ReadObject(previousValue, Name));
            }

            var djv = new DynamicJsonValue
            {
                [Value.Name] = Value.ToJson()
            };

            return(context.ReadObject(djv, Name));
        }