codeigniter-mongodb-library
codeigniter-mongodb-library copied to clipboard
How to use distinct query using this library? I want to fetch distinct values of fields from collection.
How to use distinct query using this library? I want to fetch distinct values of fields from collection. There is a function for distinct in library. I have used function from controller by below code.
$logs = $this->mongo_db->distinct('logs', 'log_section');
echo "<pre>";print_r($logs);exit;
Here logs is collection name and log_section is field name but i am getting below error
A PHP Error was encountered
Severity: Notice
Message: Undefined property: MongoDB\Driver\Manager::$logs
Filename: libraries/Mongo_db.php
Line Number: 1337
Backtrace:
File: /var/www/html/nkninst/master/application/libraries/Mongo_db.php
Line: 1337
Function: _error_handler
File: /var/www/html/nkninst/master/application/controllers/Migration.php
Line: 48
Function: distinct
File: /var/www/html/nkninst/master/index.php
Line: 315
Function: require_once
@vidhisampat2807 do you found the way to implement this function?