Yup, add any dummy element of any kind (since a collection can be mixed) and 
you have a work-around. You could instead bypass the query if the search 
collection is empty, that would be logical, might even be (insignificantly) 
more efficient <smirk>.

Keisuke mentions a potential issue about "runtime"… I've not tested this 
behavior when compiled.

Left to ponder: is it a bug or a feature?  Either way I'm not seeing it as 
"appropriate". 



> On Mar 3, 2020, at 3:57 AM, Adrian Boone via 4D_Tech <[email protected]> 
> wrote:
> 
> That's exactly what I assumed - if the collection is empty, you'd expect that 
> "not in collection" would return everything, but in my experience (v17.1) it 
> returns nothing! The workaround I have for now is to add a dummy element to 
> the collection and that works as expected. In my case it's a collection of 
> UUIDs from another ORDA query, so I just add a garbage UUID, but I guess even 
> adding an empty string would do the trick?
> 
> Adrian
> 
> On 03/03/2020 08:52, Keisuke Miyako via 4D_Tech wrote:
>> I do not have any insider knowledge on this particular point,
>> but I would assume that the runtime simply ignores the instruction and 
>> return all entities if the collection is empty (length=0),
>> since the condition is the inverse of a "false" statement.
>> 
>> matching an empty string is a different equation.
>> any string of any length that matches an empty string according to unicode 
>> collation for the current locale rules is a match.
>> control characters, non characters, etc. that are not identical to "" can 
>> still be equivalent to "".
>> such entities must be removed from the resulting entity selection in this 
>> case because of the "NOT".
>>  
>>> On Mar 3, 2020, at 17:26, Douglas Cryer via 4D_Tech <[email protected]> 
>>> wrote:
>>> 
>>> Re:
>>> Why is my query of
>>>        NOT(IN [])
>>>   versus
>>>        NOT(IN [""])
>>> producing difference results?
>> **********************************************************************
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:[email protected]
>> **********************************************************************
> 
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to