-
Notifications
You must be signed in to change notification settings - Fork 125
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
Setup with doctrine/mongodb-odm #58
Comments
If you just want to run the ODM test suite against the adapter, check out the changes I have made in If you want to use mongodb-odm in a project running on PHP 7 (on PHP 5.x, please use ext-mongo directly) the changes will be different and need to be made in your package only. Unfortunately, I haven't found a way for this library to specify that it is replacing or providing Quick example: let's say you have the following composer.json:
After all changes,
Please note that the As for getting errors while running tests, I'm going to guess it's due to gravitational waves. I'm more than happy to provide a more thorough explanation if you tell me what errors you're getting. |
Damn you Einstein :P |
@alcaeus thanks for info, gravitational waves just hilarious :P.
I've managed to install all vendors without composer complaining about
But I've seen already this issue related with PHP7 types declaration compatibility in mongodb-odm repo, so I will look for solution there. UPDATE I've seen that you merged PR with fixing PHP7 incompat. issues: doctrine/mongodb-odm@f66da89 |
Ah, yeah. I've played around with this stuff for too long.
I've written all of these issues down to add them to the official documentation once the time comes. |
@alcaeus I ended up with this
I have setup quickly simple CRUD application and for now it seems to be working. Wondering though why
Notes: |
I had a similar error when running a large MongoDB project against the adapter, so I'm going to be checking that out as well. Quite weird though since the ODM test suite still runs fine for me here. I'll let you know once I find something, thanks for the report! |
Maybe this is matter of Mongo version. Thanks for help! |
It shouldn't since I'm running 3.2 here as well. |
@ustrugany Since I can't reproduce this here, could you run the following in the mongo shell and paste the output?
|
Never mind - I've found the issue. System collections weren't properly filtered out so on databases migrated from older versions you would have the |
The issue with system collections was fixed in #59, should work for you now. |
@alcaeus thanks for quick reaction. Yes |
Using this: foreach ($collections as $collection) {
if (!preg_match('/system\..*/', $collection->getName())) {
$collection->drop();
}
} Gave me result:
Yeah and your fix actually do similar thing. Nice. Thanks again for help. I think that this thread can be closed. |
Glad to hear it worked for you! |
Is it possible to configure doctrine/mongodb-odm to work with ext-mongodb instead of ext-mongo using alcaeus/mongo-php-adapter? I followed instructions included your adapter in doctrine/mongodb-odm@dev-master but yet while running tests, i've got plenty of errors...
modified doctrine/mongodb-odm composer.json:
The text was updated successfully, but these errors were encountered: