Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB\Collection doesn't have group method.. #1162

Open
yedemon opened this issue Sep 11, 2019 · 4 comments
Open

MongoDB\Collection doesn't have group method.. #1162

yedemon opened this issue Sep 11, 2019 · 4 comments

Comments

@yedemon
Copy link

yedemon commented Sep 11, 2019

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?

@ikkez
Copy link
Collaborator

ikkez commented Sep 15, 2019

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
Though the newer MongoDB PHP lib and its MongoDB PECL ext are compatible with older one, the grouping feature has changed with newer versions and they now use the aggregate framework that takes care about grouping and such. You can either use an older PECL extention, or help us write a patch for the mongo mapper as it seems that is has not been used much in the past, sorry.

ref.
https://docs.mongodb.com/php-library/current/reference/method/MongoDBCollection-aggregate/
https://docs.mongodb.com/php-library/current/tutorial/crud/#complex-queries-with-aggregation

@yedemon
Copy link
Author

yedemon commented Sep 17, 2019 via email

@ikkez
Copy link
Collaborator

ikkez commented Sep 17, 2019

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 ;)

@yedemon
Copy link
Author

yedemon commented Sep 17, 2019

Okay... thanks.. i'll try..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants