code: public function set($key, $value)
      {
          $pair = $this->repository->find($key);
          if ($pair === null) {
              $pair = new Pair();
              $pair->setId($key);
          }
  
          $pair->setValue($value);
          $this->save($pair);
  
          return $pair;
      }
docs: Sets pair value. Returns pair with values.
  
  @param string $key
  @param mixed  $value
  
  @return DocumentInterface