You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a) Products have "trilian" attribute, its either true, false or null in the database. (its basically an optional boolean)
b) Products have "boolean" attribut, its always either true or false
c) Products have "boolean" attribute, but we encode it as either true or not existing (null). This is the same as b semantically.
now clients can use the attribute in three different ways
1.) give me everything where attribute = true. would return only products with true in all cases
2.) give me everything where attribute = false. I think this should also return products where the value is false in all cases (or null or not existing in case c)
3.) give me everything no matter the attribute. The attribute does not exist in the filter query:
this should return all products in all cases
4.) give me everything where the attribute is null. (so the attribute exists in the filter query and its value is null. Now here it differs. In case a you would probably return only the products where the attribute indeed is null (or does not exist at all). Its not so clear in case b and c and should be documented then. Either this could return only the products where the attribute is false or ignore the attribute.
I think both cases a and b can make sense for certain attributes. I would avoid c as it does not allow to distinguish between a and b. But on the other hand, a can be emulated with a list filter which is maybe more clear... 🤔
Mongodb makes it a bit harder, because you cant easily force the field to always be either true or false, so you tend to treat a non existing field as a false, which boils down to treat b and c identical.
Do you have any suggestions on how to proceed @macrozone ?
The text was updated successfully, but these errors were encountered: