See https://github.com/colinmollenhour/mongodb-php-odm/pull/49