can anyone see why `expiresAt` filter is not worki...
# orm-help
z
can anyone see why
expiresAt
filter is not working - it gives me empty [] for entries?
l
i think you need to use OR and AND
ah no i didnot see
AND: { OR: [{ expiresAt:null }, { expires_lt: $dtNow } ]
try it
z
nope, can't have AND: ... without
where
j
the
OR
should be an array of multiple objects?
replace his
AND
with
where
z
then it's same as in original query
I'm trying to get "either expiresAt is null OR less than now()"
j
how about...
Copy code
where: {
  OR: [
    { expiresAt: null },
    { expiresAt_lt: $dtNow },
  ]
}
z
well that's the same where clause I'm using
which is good, you also would have done it this way... but it's nut yielding any results, wonder if there's a bug there?
l
no check it you use the two expires in the same object
n
@lucas is correct.
z
I get same results (entries: [] ) with
Copy code
categories(orderBy: index_ASC) {
      id
      index
      bcolor
      fcolor
      title
      entries(
        orderBy: title_ASC
        where: {AND: [{ OR: [{ expiresAt: null, expiresAt_lt: $dtNow }] }]}
      )
n
Are there such entries? 🙂
z
yes but all are (currently) null
n
ah just looked at your query again. You are still using the wrong syntax.
z
ahh.... missing two brackets !