Giter VIP home page Giter VIP logo

cakephp-monga's People

Contributors

lewestopher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cakephp-monga's Issues

Class 'MongoClient' not found in Connection.php

After bootstrap & app.php configuration, i tried below code

$mongoAdapter = ConnectionManager::get('mongo_db');
$mongodb = $mongoAdapter->connect();

It says Exception: Class 'MongoClient' not found in [/mnt/d/www/html/cronRevamp/vendor/league/monga/src/League/Monga/Connection.php, line 54]

Cakephp : 3.5.12
Mongod -version : db version v3.2.19
Ubuntu : ubuntu1604

Error at Access to a collection

Hello, I'm getting a Fatal error: Class 'App\Model\MongoCollection\UsersCollection' not found in ..cake3test/vendor/lewestopher/cakephp-monga/src/MongoCollection/CollectionRegistry.php on line 85

i've changed the Namespace to test as CollectionRegistry::setNamespace('App\Model\AlternativeCollectionLocation\');

and i got the same error

Error: Call to undefined method DebugKit\Database\Log\DebugLog::getContext()

Upon installation, this is the error I get which seems to be triggered from this code:

$mongodb = $cake_monga->connect();

This is the full error message:

Error: Call to undefined method DebugKit\Database\Log\DebugLog::getContext()
File /vendor/lewestopher/cakephp-monga/src/Database/MongoConnection.php
Line: 296

Thanks!

How to use MongoDB instead of MongoClient()

$cake_monga = ConnectionManager::get('datasource');

I want to log query in file like mysql.

and how can i use MongoDB conenction? instead of MongoClient() because MongoClient is deprecated.

new MongoDate\BSON\UTCDateTime not found

Hi,

I have cakePHP 3, MongoDB 3, PHP 5.6.
In my code I have
$start_date = new MongoDate\BSON\UTCDateTime(strtotime($start));

But it gives me the following error:
Error: Class 'App\Controller\MongoDate' not found
File /var/www/caketest/src/Controller/ReportsController.php
Line: 53

Can you please tell whether I need to include or use any files in the controller or anything is missing..
Thanks in advance :)

You have not configured a default database for Datasource mongo_db

However:

'Datasources' => [
        'mongo_db' => [
            'className' => 'CakeMonga\Database\MongoConnection',
            'dns' => env('MONGODB_URL', 'mongodb://localhost:27017/app')
        ],
        'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'localhost',
            ...
        ]
];

How can i use aggregate function

I have GroupsCollection extended BaseCollection
and i have to select data by using aggregate function
like in BaseCollection
$this->aggregate([]); //getting all record

$this->aggregate(['group'=>['name']]); //getting error
please help me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.