KnpLabs/knp-components — pull request #12 by MDrollette (2012-03-05 21:28:32+00:00)
Title: remove check for field existing. not required for ODM.

I don't see a need to check if the field exists as mongo will gladly sort by anything you give it. And that's sometimes a desirable feature.

Specifically, the problem I ran into was with single-collection inheritance. The BaseClass was the target object which didn't explicitly contain the field i was sorting on as it was in some of the inherited classes instead. As a result, this exception was thrown. Everything works as expected without this check.