code: public function update(Repository $repository, $id, array $data)
      {
          $repository->getManager()->bulk(
              'update',
              $repository->getType(),
              [
                  '_id' => $id,
                  'doc' => $data,
                  'doc_as_upsert' => true
              ]
          );
      }
docs: {@inheritdoc}