Using map: filter on array of Products to access a metafield value

If I remember properly, you can’t use nested properties in map, so this would not work

collection.products | map: 'metafields.custom.model'

while this will:

collection.products | map: 'price'

Also, keep int mind that big arrays like collection.products are paginated in Shopify, so you would only be accessing first 50’ish products.