Array Filters

Count

returns number

Outputs the number of items in the array.

Examples

Input

{{ collection.products | count }}

Output

4

JSON

returns string

Outputs the array as a JSON string, useful for debugging.

Examples

Input

{{ product.media | json }}

Output

[{
  "id": "gid://shopify/ImageSource/25200891068581",
  "altText": null,
  "url": "https://cdn.shopify.com/s/files/1/0584/6053/6997/products/75_687f7a12-dc2d-4f61-bc14-31d2e087aebd.jpg?v=1651267183",
  "type": "image"
}, {
  "id": "gid://shopify/ImageSource/25434767425701",
  "altText": null,
  "url": "https://cdn.shopify.com/s/files/1/0584/6053/6997/products/Productimage2.jpg?v=1656684904",
  "type": "image"
}, {
  "id": "gid://shopify/ImageSource/25200891101349",
  "altText": null,
  "url": "https://cdn.shopify.com/s/files/1/0584/6053/6997/products/200_802b1909-7331-46f5-a1f6-23c6971a4b34.jpg?v=1656684904",
  "type": "image"
}]