async update(request) {
    const id = request.getId();
    const content = request.getBody();
    const userId = request.getKuid();
    const silent = request.getBoolean("silent");
    const refresh = request.getString("refresh", "false");
    const retryOnConflict = request.input.args.retryOnConflict;
    const source = request.getBoolean("source");
    const { index, collection } = request.getIndexAndCollection();

    const modifiedRequest = await global.kuzzle.validation.validate(
      request,
      false,
    );

    // Add metadata
    const pipeMetadataResult = await this.pipe(
      "generic:document:injectMetadata",
      {
        metadata: {
          updatedAt: Date.now(),
          updater: userId,
        },
        request,
      },
    );

    const updatedDocument = await this.ask(
      "core:storage:public:document:update",
      index,
      collection,
      id,
      {
        ...content,
        _kuzzle_info: pipeMetadataResult.metadata,
      },
      {
        injectKuzzleMeta: false,
        refresh,
        retryOnConflict,
        userId,
      },
    );

    const _updatedFields = extractFields(content, {
      fieldsToIgnore: ["_kuzzle_info"],
    });

    if (!silent) {
      await this.ask(
        "core:realtime:document:notify",
        modifiedRequest,
        actionEnum.UPDATE,
        {
          _id: updatedDocument._id,
          _source: updatedDocument._source,
          _updatedFields,
        },
      );
    }

    if (source) {
      return updatedDocument;
    }

    return {
      _id: updatedDocument._id,
      _source: content,
      _version: updatedDocument._version,
    };
  }
Update a document through the persistent layer

@param {Request} request
@returns {Promise<Object>}