Doctrine\MongoDB\Tests\Query\BuilderTest::testUnsetField PHP Method

testUnsetField() public method

public testUnsetField ( )
    public function testUnsetField()
    {
        $qb = $this->getTestQueryBuilder()->update()->field('hits')->unsetField()->field('username')->equals('boo');
        $expected = ['username' => 'boo'];
        $this->assertEquals($expected, $qb->getQueryArray());
        $expected = ['$unset' => ['hits' => 1]];
        $this->assertEquals($expected, $qb->getNewObj());
    }
BuilderTest