Opensoft\Rollout\Storage\MongoDBStorageAdapter::set PHP Méthode

set() public méthode

public set ( $key, $value )
    public function set($key, $value)
    {
        $collection = $this->getCollectionName();
        $this->mongo->{$collection}->update(['name' => $key], ['$set' => ['value' => $value]], ['upsert' => true]);
    }

Usage Example

 public function testSet()
 {
     $adapter = new MongoDBStorageAdapter($this->mongo);
     $adapter->set('key', 'value');
 }