I would like to query my database by items in the keywords field in the frontmatter, which is a list/array of strings. The problem is that the ‘contains’ operator matches substrings of items. The documentation states that operator is supposed to check ‘if any of the array elements ==equals== the given value’ when the container object is a list.
--- keywords: - apple ---
--- keywords: - ap ---
My query looks like this:
TABLE keywords AS "Keywords" WHERE contains(keywords, "ap")=true
The desired outcome is that only file2 is shown, but it turned out that file1 also showed up.
I have tried changing the keywords field into a dictionary:
--- keywords: - apple: [anything, or null] ---
--- keywords: - ap: [anything, or null] ---
This allows me to perform the desired query, however it introduces other problems, such as the display of the keywords field in a table when it contains multiple values.
Any help would appreciated!