Sokil\Mongo\CollectionTest::testDeleteDocuments_ExpressionAsCallable PHP Method

testDeleteDocuments_ExpressionAsCallable() public method

    public function testDeleteDocuments_ExpressionAsCallable()
    {
        // add
        $this->collection->createDocument(array('param' => 1))->save();
        $this->collection->createDocument(array('param' => 2))->save();
        $this->collection->createDocument(array('param' => 3))->save();
        $this->collection->createDocument(array('param' => 4))->save();
        // delete
        $this->collection->deleteDocuments(function ($expression) {
            $expression->whereGreater('param', 2);
        });
        // test
        $this->assertEquals(2, count($this->collection));
    }
CollectionTest