Sokil\Mongo\ExpressionTest::testWhereElemMatchWithLogicalNot PHP Method

testWhereElemMatchWithLogicalNot() public method

    public function testWhereElemMatchWithLogicalNot()
    {
        // create new document
        $document = $this->collection->createDocument(array('param' => array(array('subparam1' => 10, 'subparam2' => 20), array('subparam1' => 200, 'subparam2' => 300))));
        $document->save();
        $documentId = $document->getId();
        // find
        $q = $this->collection->find();
        $q->whereNot($q->expression()->whereElemMatch('param', $q->expression()->where('subparam1', 777)));
        $document = $q->findOne();
        $this->assertNotEmpty($document);
        $this->assertEquals($documentId, $document->getId());
    }