Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMongoDB\Collection doesn't have group method.. #1162
Comments
|
The Mongo mapper was only built and tested for the old legacy Mongo PECL extention and then patched for the newer MongoDB extention. The used collection->group method is existing right here: https://www.php.net/manual/de/mongocollection.group.php ref. |
|
Many thanks.. after days study.. i've realized that "group" is mainly for old version mongo, and "aggregate" is for newer MongoDB.. But this "aggregate" thing is way too far for me to coding into proper functions. I've refered to many other frameworks, like think-orm, lavaral, but none-of-them resolve aggregate well.
I am using fatfree framework for 2 years, and it's quite to my taste. I feel honored to write something for it. But there is a question that confuses me. In lib/db/mongo.php that writes. "$this->db=(new \MongoDB\Client($dsn,$options?:[]))->$dbname;". Is this "\MongoDB\Client" comes from mongo-php-library(https://github.com/mongodb/mongo-php-library), which i think is not matched for "fatfree"?
Thanks again for replying.
Yours, sincerely
|
|
yes it is... the mongo-php-library github repository is the newer next-gen lib that we should adapt to.. or rewrite it completely and use the low-level-api from https://www.php.net/manual/en/set.mongodb.php which probably becomes a lot of fun implementing it... great chance for creative minds ;) |
|
Okay... thanks.. i'll try.. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

I see this frame already uses new \MongoDB\Client to support new Mongodb drive on php7, however in db/mongo/mapper.php, when handling 'group', it uses "$this->collection->group" which doesn't exist in class MongoDB\Collection. What should i do?