Added type conversion in from_mongo().