public function hydrate($value)
    {
        if ($value instanceof MongoId) {
            return (string)$value;
        }
        
        if ($this->nullable && $value === null) {
            return null;
        }
        
        throw new Exception\InvalidArgumentException(sprintf(
            'Invalid value: must be an instance of MongoId, "%s" given.',
            is_object($value) ? get_class($value) : gettype($value)
        ));
    }