Doc #75364 [Opn->Fbk]: undefined method MongoDB\Collection::group()
| From: | requinix@php.net | Date: | Thu, 12 Oct 2017 11:31:38 +0000 |
| Subject: | Doc #75364 [Opn->Fbk]: undefined method MongoDB\Collection::group() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15072@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75364&edit=1
ID: 75364
Updated by: requinix@php.net
Reported by: a dot pendinelli92 at gmail dot com
Summary: undefined method MongoDB\Collection::group()
-Status: Open
+Status: Feedback
Type: Documentation Problem
-Package: mongodb
+Package: Unknown/Other Function
Operating System: Windows 8.1
PHP Version: 7.1.10
Block user comment: N
Private report: N
New Comment:
The only MongoDB\Collection I can find is at
https://github.com/mongodb/mongo-php-library
which we don't manage, and their docs
https://docs.mongodb.com/php-library/current/reference/class/MongoDBCollection/
don't mention a group() method.
Previous Comments:
------------------------------------------------------------------------
[2017-10-12 11:20:12] a dot pendinelli92 at gmail dot com
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()
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75364&edit=1