Sokil\Mongo\ExpressionTest::testWhereElemMatchWithoutHelpers PHP Method

testWhereElemMatchWithoutHelpers() public method

    public function testWhereElemMatchWithoutHelpers()
    {
        // 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
        $search = $this->collection->find()->where('param', array('$elemMatch' => array('subparam1' => array('$gt' => 0), 'subparam2' => array('$lt' => 30, '$gt' => 10))));
        $document = $search->findOne();
        $this->assertNotEmpty($document);
        $this->assertEquals($documentId, $document->getId());
    }