Added pymongo support for flexible error querying