diff --git a/data/filters.json b/data/filters.json index 7b63e89..f691caa 100644 --- a/data/filters.json +++ b/data/filters.json @@ -2250,7 +2250,28 @@ "array_value": "" } ], - "examples": [], + "examples": [ + { + "name": "", + "description": "", + "syntax": "", + "path": "/collections/all", + "raw_liquid": "{% assign product = collection.products | find: 'vendor', \"Polina's Potent Potions\" %}\n\n{{ product.title }}", + "parameter": false, + "display_type": "text", + "show_data_tab": true + }, + { + "name": "Returns `nil` when no items match the specified property value.", + "description": "", + "syntax": "", + "path": "/collections/all", + "raw_liquid": "{% assign product = collection.products | find: 'vendor', \"Polina's Potions\" %}\n\n{{ product.title | default: \"No product found\" }}", + "parameter": false, + "display_type": "text", + "show_data_tab": true + } + ], "summary": "Returns the first item in an array with a specific property value.", "syntax": "array | find: string, string", "name": "find" @@ -2269,7 +2290,28 @@ "array_value": "" } ], - "examples": [], + "examples": [ + { + "name": "", + "description": "", + "syntax": "", + "path": "/collections/all", + "raw_liquid": "{% assign index = collection.products | find_index: 'vendor', \"Polina's Potent Potions\" %}\n\n{{ index }}", + "parameter": false, + "display_type": "text", + "show_data_tab": true + }, + { + "name": "Returns `nil` when no items match the specified property value.", + "description": "", + "syntax": "", + "path": "/collections/all", + "raw_liquid": "{% assign index = collection.products | find_index: 'vendor', \"Polina's Potions\" %}\n\n{{ index | default: \"No index found\" }}", + "parameter": false, + "display_type": "text", + "show_data_tab": true + } + ], "summary": "Returns the index of the first item in an array with a specific property value.", "syntax": "array | find_index: string, string", "name": "find_index" @@ -2358,7 +2400,28 @@ "array_value": "" } ], - "examples": [], + "examples": [ + { + "name": "", + "description": "", + "syntax": "", + "path": "/collections/all", + "raw_liquid": "{% assign has_potent_potions = collection.products | has: 'vendor', \"Polina's Potent Potions\" %}\n\n{{ has_potent_potions }}", + "parameter": false, + "display_type": "text", + "show_data_tab": true + }, + { + "name": "Returns `false` when no items match the specified property value.", + "description": "", + "syntax": "", + "path": "/collections/all", + "raw_liquid": "{% assign has_potent_potions = collection.products | has: 'vendor', \"Polina's Potions\" %}\n\n{{ has_potent_potions }}", + "parameter": false, + "display_type": "text", + "show_data_tab": true + } + ], "summary": "Tests if any item in an array has a specific property value.", "syntax": "array | has: string, string", "name": "has" @@ -2667,7 +2730,18 @@ "array_value": "untyped" } ], - "examples": [], + "examples": [ + { + "name": "", + "description": "", + "syntax": "", + "path": "/collections/all", + "raw_liquid": "{% assign polina_products = collection.products | reject: 'vendor', \"Polina's Potent Potions\" %}\n\nProducts from other vendors than Polina's Potent Potions:\n\n{% for product in polina_products -%}\n - {{ product.title }}\n{%- endfor %}", + "parameter": false, + "display_type": "text", + "show_data_tab": true + } + ], "summary": "Filters an array to exclude items with a specific property value.", "syntax": "array | reject: string, string", "name": "reject" diff --git a/data/objects.json b/data/objects.json index 82e5b1f..cbda0ae 100644 --- a/data/objects.json +++ b/data/objects.json @@ -8989,7 +8989,7 @@ "examples": [ { "name": "Access metafields", - "description": "The access path for metafields consists of two layers:\n\n- namespace - A grouping of metafields to prevent conflicts.\n- key - The metafield name.\n\nGiven this, you can access the metafield object with the following syntax:\n\n```liquid\n{{ resource.metafields.namespace.key }}\n```\n\n> Note:\n> The namespace and key values will always be `snake_case`, regardless of the casing used in the metafield definition.\n", + "description": "The access path for metafields consists of two layers:\n\n- namespace - A grouping of metafields to prevent conflicts.\n- key - The metafield name.\n\nGiven this, you can access the metafield object with the following syntax:\n\n```liquid\n{{ resource.metafields.namespace.key }}\n```\n", "syntax": "", "path": "/products/health-potion", "raw_liquid": "Type: {{ product.metafields.information.directions.type }}\nValue: {{ product.metafields.information.directions.value }}",