public static function convertProjection($fields)
    {
        if (! is_array($fields) || $fields === []) {
            return null;
        }

        if (! TypeConverter::isNumericArray($fields)) {
            $projection = TypeConverter::fromLegacy($fields);
        } else {
            $projection = array_fill_keys(
                array_map(function ($field) {
                    if (!is_string($field)) {
                        throw new \MongoException('field names must be strings', 8);
                    }

                    return $field;
                }, $fields),
                true
            );
        }

        return TypeConverter::fromLegacy($projection);
    }