|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-12 11:31 UTC] requinix@php.net
-Status: Open
+Status: Feedback
-Package: mongodb
+Package: Unknown/Other Function
[2017-10-12 11:31 UTC] requinix@php.net
[2017-10-12 11:45 UTC] derick@php.net
-Status: Feedback
+Status: Not a bug
[2017-10-12 11:45 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 22:00:02 2025 UTC |
Description: ------------ While trying to use group() function for MongoDB Fatal error: Uncaught Error: Call to undefined method MongoDB\Collection::group() Test script: --------------- <?php require 'C:/xampp/php/vendor/autoload.php'; // include Composer's autoloader $client = new MongoDB\Client("mongodb://localhost:27017"); $collection = $client->mongo_Test->users; $keys = array("id" => 1); $initial = array("items" => array()); $reduce = "function (obj, prev) { prev.items.push(obj.name); }"; //not working $g = $collection->group($keys, $initial, $reduce); var_dump($g); ?> Actual result: -------------- Fatal error: Uncaught Error: Call to undefined method MongoDB\Collection::group()