make compatible with pymongo >= 2.5.0