Sokil\Mongo\DocumentTest::testPullFromThreeDimensionalUsingExpression PHP Method

testPullFromThreeDimensionalUsingExpression() public method

Deprecation: using expression as value
    public function testPullFromThreeDimensionalUsingExpression()
    {
        $this->collection->delete();
        // create document
        $doc = $this->collection->createDocument(array('some' => array(array('sub' => array(array('a' => 1), array('b' => 2))), array('sub' => array(array('a' => 3), array('b' => 4))))));
        $doc->save();
        // push array to array
        $doc->pull(function ($e) {
            $e->where('some', array('sub' => array('a' => 1)));
        });
        $doc->save();
        $this->assertEquals(array(array('sub' => array(array('a' => 3), array('b' => 4)))), $this->collection->getDocument($doc->getId())->some);
    }
DocumentTest