How can I count a multivalue field's values in twig?
{{ node.field_mytext.count }} => faced with error

This does not work, because the method count is not allowed in twig policies:


  core/lib/Drupal/Core/Template/TwigSandboxPolicy.php


{{ content.field_mytext | length }}?

This does not work, because content is a render array with a lot of additional keys.

This works: Convert field to array and count    

{{ node.field_mytext.getvalue | length }}