Hi,
I have references to the collection Stores/Products. Let's say that I am making a query to obtain only the products with IDs in array[arr], and that match with ".hasSome" of the referenced field. To filter by the IDs of the array, I use either "eq" or "hasSome".
This works ok when one or more products of the array have a referencefield, in other words, when ".hasSome" matched at least one item.
But, if ".hasSome" matches zero items, meaning none of the products have a referenceField, then all items are passed, none of them are filtered.
Therefore, it's undesirable behavior.
[EDIT: The blue paragraph it's unsure, as its also happening with items that have no relationship, but other items do. In this case, the behavior fails with the items that have no relationship]
[I have been able to isolate it, to happen only when none of the products in the whole collection have that referencedField, meaning this erratic behavior happens when the collection Stores/Products have zero reference field to the one in ".hasSome".
Regardless of the ids in the array, if there's at least one product in Stores/Products that has a referenceField, then this doesn't happen. So ".hasSome" acts correctly not allowing to retrieve any item. A workaround was to create a dummy product, which is referenced to the other collection. Finally, this solves the issue, as there is always one relationship among both collections, allowing ".hasSome" to work correctly.]
My question. Is this a bug? Or ".hasSome" can only work correctly as long as there one relationship among both collections?
Thank you