I’m sorry for the confusion I brought to the table, @alltagsverstand , my brain just shortcutted somewhere, failing to accept that contains()
could work with arrays as both arguments. Not sure why, but in the recent past I’ve presented some answers where I needed to do map()
on one of the arrays, to get it to work somehow. (Or I’ve been mistaken in doing so, as well).
Truly sorry for the misbelief, and the confusion I brought to the table. I was falsely under the belief that contains()
would only return a single value related to whether it contained the last argument in the first argument, and not that it worked like a matrix returning an array of boolean values related to each element of the last argument being contained or not within the first argument.
A test case showing various combinations
```dataview
TABLE WITHOUT ID tmp[0], tmp[1], contains(tmp[0], tmp[1])
FLATTEN list(
[ 0, 0 ],
[ 0, [1] ],
[ 0, [1, 2] ],
[ 0, [1, 2, 3] ],
[ [1], 0 ],
[ [1], [1] ],
[ [1], [1, 2] ],
[ [1], [1, 2, 3] ],
[ [1, 2], 0 ],
[ [1, 2], [1] ],
[ [1, 2], [1, 2] ],
[ [1, 2], [1, 2, 3] ],
[ [1, 2, 3], 0 ],
[ [1, 2, 3], [1] ],
[ [1, 2, 3], [1, 2] ],
[ [1, 2, 3], [1, 2, 3] ]
) as tmp
WHERE file.path = this.file.path
```
Result of this query
I could convolute the test queries even more by introducing letters and partial matches, but it does show the main point of splitting the last argument, and doing singular matching related to the first argument. Which I falsely believed it wouldn’t do. Sorry…