Skip to content

error on find() : Call to undefined method Hayko\Mongodb\Database\Driver\Mongodb::prepare() #23

Description

@ahmadbarrin

Hello,

I start working on CakePHP and MongoDB, and I'm not able to use your library correctly. It might be a mistake from me but still I prefer to ask if it's a well-know error.

I'm using last CakePHP 3.5 version (3.5.17)
When I go on URL "http://127.0.0.1/MyCakePHPApp/articles/" to list articles stored in MongoDB, it display following error :
"Call to undefined method Hayko\Mongodb\Database\Driver\Mongodb::prepare()
Error
An Internal Server Error Occurred"

Here is my code :
ArticlesController.php
// src/Controller/ArticlesController.php
namespace App\Controller;
class ArticlesController extends AppController {
public function index() {
$this->loadComponent('Paginator');
$articles = $this->Paginator->paginate($this->Articles->find());
$this->set(compact('articles'));
}
}

ArticlesTable.php :
use Hayko\Mongodb\ORM\Table;
class ArticlesTable extends Table {
}

Thanks in advanced for your help
Ahmad

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions