note 116734 added to mongocollection.group
| From: | ury dot zend at gmail dot com | Date: | Fri, 20 Feb 2015 21:00:03 +0000 |
| Subject: | note 116734 added to mongocollection.group | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201769@lists.php.net to get a copy of this message | ||
quoting Evgeniy Abduzhapparov example for correction, since is not working on newest php mongo
driver version
instead of use:
<?php
$initial = array('tags'=>array(), 'count'=>0);
?>
for var tags,
you have to cast the empty array to an object or use new stdClass()
<?php
$initial = array('tags'=> (object) array(), 'count'=>0);
$initial = array('tags'=> new stdClass(), 'count'=>0);
?>
----
Server IP: 72.52.91.14
Probable Submitter: 177.249.184.13
----
Manual Page -- http://php.net/manual/en/mongocollection.group.php
Edit -- https://master.php.net/note/edit/116734
Del: integrated -- https://master.php.net/note/delete/116734/integrated
Del: useless -- https://master.php.net/note/delete/116734/useless
Del: bad code -- https://master.php.net/note/delete/116734/bad+code
Del: spam -- https://master.php.net/note/delete/116734/spam
Del: non-english -- https://master.php.net/note/delete/116734/non-english
Del: in docs -- https://master.php.net/note/delete/116734/in+docs
Del: other reasons-- https://master.php.net/note/delete/116734
Reject -- https://master.php.net/note/reject/116734
Search -- https://master.php.net/manage/user-notes.php