#community-help

Understanding `filter_by` String Parsing in Documentation

TLDR Harpreet inquired about the difference between Sneaker and Sneaker in filter_by. Jason clarified that string literals with commas should be enclosed in backticks.

Powered by Struct AI
5
22mo
Solved
Join the chat
Nov 14, 2021 (22 months ago)
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
07:17 PM
Hey I have a question regarding filter_by from the docs :

You can also filter using multiple values and use the backtick character to denote a string literal: category:= [Running Shoes, Men, Sneaker].

Is there any difference between Sneaker and Sneaker while parsing?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:22 PM
There should NOT be a difference if the string doesn't have a comma - that was the main reason we introduced backtick escaping
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
07:26 PM
Hmm thanks. Just gotta enclose string having commas in them !
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:28 PM
Sorry typo above - fixed it now
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
07:29 PM
ah alright