I am trying to use the hasSome. According to the documentation:
The hasSome() function refines a WixDataQuery or WixDataFilter to only match items where the array value of the specified property contains any of the specified values.
When I try it it looks the haSome does EQUAL comparison and not CONTAINS. A record is selected only if one of the value in the hasSome fully EQUALS to a value in the collection and not contained in the collection.
For example:
if “colors” field of record #1 has the value of: “red,purple” and I do
let newQuery = query.hasSome(“colors”, “red”, “yellow”, “blue”);
then record #1 will not be selected.
however it will be selected if I do:
let newQuery = query.hasSome(“colors”, “red,purple”, “yellow”, “blue”);
I am afraid you did not answer my question. You just put a simple example. My question is very simple: In the formal API documentation it says: "contains " and not " equals ". In reality it performs “equal”. Either fix the documentation or the functionality! I would ask that someone knowledgeable from Wix will answer this.
Thank you. It would have been better to modify your implementation of hasSome, not the documentation as “contains” is more useful than “equal” (you can use “contain” to implement “equal” by selection of your data but not the other way around).