Sokil\Mongo\CollectionTest::testUpdateMultiple_WithUnacknowledgedWriteConcern PHP Method

testUpdateMultiple_WithUnacknowledgedWriteConcern() public method

    public function testUpdateMultiple_WithUnacknowledgedWriteConcern()
    {
        // get collection
        $this->collection->setUnacknowledgedWriteConcern();
        // create documents
        $d1 = $this->collection->createDocument(array('p' => 1));
        $d1->save();
        $d2 = $this->collection->createDocument(array('p' => 1));
        $d2->save();
        // packet update
        $this->collection->updateMultiple($this->collection->expression()->where('p', 1), $this->collection->operator()->set('k', 'v'));
        // test
        foreach ($this->collection->find() as $document) {
            $this->assertArrayHasKey('k', $document->toArray());
        }
    }
CollectionTest