ORDA - NOT(IN)

2020-03-01 Thread Tom-Lists via 4D_Tech
Hi All, I'm generally in love with ORDA, but: Now assuming that the field "entityUUID" is populated (no null values), How come I get different results with: $vC_uuidsToIgnore:=New collection() $deletes:=ds.SyncDeletes.query("NOT(entityUUID IN :1)";$vC_uuidsToIgnore) $deletes -->

Re: ORDA - NOT(IN)

2020-03-01 Thread Jeremy French via 4D_Tech
Hi Tom. I believe this statement has a silent syntax error, which the compiler/syntax checker fails to flag: $vC_uuidsToIgnore:=New collection() Remove the parenthesis so you have: $vC_uuidsToIgnore:=New collection See: https://doc.4d.com/4Dv18/4D/18/New-collection.301-4505843.en.html

Re: ORDA - NOT(IN)

2020-03-01 Thread Tom-Lists via 4D_Tech
That's an interesting find, but I don't see that as the case as the value of the variable (as seen in the debugger) remains the same with or without the NEW COLLECTION parenthesis. So my question still stands: Why is my query of NOT(IN []) versus NOT(IN [""]) producing

Re: ORDA - NOT(IN)

2020-03-01 Thread Chip Scheide via 4D_Tech
maybe because the array [] is not empty when there is a an empty string in it. and the query, in the second case is looking for empty string values, or just string values > > NOT(IN []) >versus > NOT(IN [""]) Hell is other people Jean-Paul Sartre ***

Re: ORDA - NOT(IN)

2020-03-03 Thread Douglas Cryer via 4D_Tech
Tom, Re: Why is my query of NOT(IN []) versus NOT(IN [""]) producing difference results? I noticed this a few weeks back. The empty collection I was using was the result of a previous query that returned a collection. I had to code around it so if the myCollection.length wa

Re: ORDA - NOT(IN)

2020-03-03 Thread Keisuke Miyako via 4D_Tech
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 equati

Re: ORDA - NOT(IN)

2020-03-03 Thread Adrian Boone via 4D_Tech
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 col

Re: ORDA - NOT(IN)

2020-03-03 Thread Douglas Cryer via 4D_Tech
Adrian, I honestly believe this to be a bug and hope that in the future it will be fixed. Below does not work: $vc_exclude:=New collection //make a simple empty collection $es_MySel:=ds.myTable.query("not(myField in :1)";$vc_exclude) Here are few ways around it: Option 1 - Check and do someth

Re: ORDA - NOT(IN)

2020-03-03 Thread Tom-Lists via 4D_Tech
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 . Keisuke mentions a potential issue about "runtime"…

Re: ORDA - NOT(IN)

2020-03-03 Thread Keisuke Miyako via 4D_Tech
one more thing, you could go deeper with $params:=New object("queryPlan";True;"queryPath";True) $esTable_1:=ds.Table_1.query("NOT (Field_2 IN :1)";New collection;$params) which yields {"Not":[{"item":"Constant Value: "}]} as opposed to $params:=New object("queryPlan";True;"queryPath";True) $

Re: ORDA - NOT(IN)

2020-03-26 Thread Keisuke Miyako via 4D_Tech
remember this discussion? good news! common sense prevails! https://bugs.4d.fr/fixedbugslist?branch=18 #ACI0100614 > 2020/03/04 9:33、Keisuke Miyako のメール: > the inverse of FALSE is TRUE, but the inverse of NULL is NULL. > it's counter-intuitive, but that how NULL works.

Re: ORDA - NOT(IN)

2020-04-04 Thread Tom-Lists via 4D_Tech
Yup, that's my bug! [ ] # Null Cheers, Tom > On Mar 26, 2020, at 5:52 PM, Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > remember this discussion? > > good news! common sense prevails! > > https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.4d.fr_fixedbugslist-3Fbra