here's a typescript variable holding dropdown tree nodes. Add "type" field to each node as a root field, do not change anything else.

```
filterTree: DropdownTreeNode<Filter>[] = [
    {
      title: 'Presents',
      children: [
        {
          title: t('manage.answered'),
          value: {
            key: 'surveyAnswers.answered',
            filter: {commentsCount: {$gt: 0}}
          },
          checked: (node) => checked(node.value),
          onClick: (node) => toggleFilter(node.value)
        },
        {
          title: t('manage.unanswered'),
          value: {
            key: 'surveyAnswers.unanswered',
            filter: {
              $or: [{commentsCount: 0}, {commentsCount: {$exists: false}}],
              email: {$exists: true}
            }
          },
          checked: (node) => checked(node.value),
          onClick: (node) => toggleFilter(node.value)
        }
      ]
    },
    surveyQuestions.length && {
      title: 'Survey',
      children: surveyQuestions.map(({_id, name, type, ratingType, options}) => {
        if (type === 'rating') {
          const ratings: DropdownTreeNode<Filter>[] = rating(ratingType).map((ratingNum) => ({
            title: ratingNum.toString(),
            value: {
              key: `surveyAnswers.${_id}.rating.${ratingNum}`,
              filter: {[`surveyAnswers.${_id}.rating`]: ratingNum}
            },
            checked: (node) => checked(node.value),
            onClick: (node) => toggleFilter(node.value)
          }));

          return {
            title: name,
            children: [createToggleAllNode(ratings), ...ratings]
          };
        }

        if (type === 'multipleChoice') {
          const choices = options.map(({id, value}) => ({
            title: value,
            value: {
              key: `surveyAnswers.${_id}.${id}`,
              filter: {[`surveyAnswers.${_id}.choiceIds`]: id}
            },
            checked: (node) => checked(node.value),
            onClick: (node) => toggleFilter(node.value)
          }));

          return {
            title: name,
            children: [createToggleAllNode(choices), ...choices]
          };
        }

        if (type === 'singleChoice') {
          const choices = options.map(({id, value}) => ({
            title: value,
            value: {
              key: `surveyQuestions.${_id}.${id}`,
              filter: {[`surveyAnswers.${_id}.choiceId`]: id}
            },
            checked: (node) => checked(node.value),
            onClick: (node) => toggleFilter(node.value)
          }));
          return {
            title: name,
            children: [createToggleAllNode(choices), ...choices]
          };
        }

        return {
          title: name,
          value: {
            key: `surveyQuestions.${_id}`,
            filter: {[`surveyAnswers.${_id}`]: {$exists: true}}
          },
          checked: (node) => checked(node.value),
          onClick: (node) => toggleFilter(node.value)
        };
      })
    },
    highlightTypes.length && {
      title: 'Highlights',
      children: highlightTypes.map(({type, color}) => ({
        title: type,
        color,
        value: {
          key: `highlights.type.${type}`,
          filter: {'highlights.type': type}
        },
        checked: (node) => checked(node.value),
        onClick: (node) => toggleFilter(node.value)
      }))
    }
  ];
```