akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
956 stars 518 forks source link

MongoDBODM/VersionRepository.php sort order #6669

Closed ahrrikis closed 7 years ago

ahrrikis commented 7 years ago

I'm reporting a Bug Hi, in the File MongoDBODM/VersionRepository.php you are sorting the Cursor bei the Filed loggedAt using ASC und DESC, this is not working for MongoDB from 2.6. You should change the Sort Order to -1 and 1, otherwise Mongo fails and you are getting an Timeout-Error, which is caused by an Issue in the Doctrine MongoDB ODM, which cannot not deal properly with empty sets (Already reportetd to Doctrine Mongo ODM).

Fixing this and the workaround for Mongo ODM to deal with empty sets, improves Akeneo with Mongos performance significantly.

Kindly Eric

momoss commented 7 years ago

Hello @ahrrikis,

If you have a look to Cursor class of Doctrine MongoDB following this namespace Doctrine\MongoDB\Cursor the sort method accept asc and desc as params, who convert to 1 and -1 before executing the request.

Therefore I close the issue. You can have more informations about your timeout error by having a look to the mongodb logs.

Regards

Philippe