Hi all, I have two `DateTime` fields in `datamodel...
# orm-help
g
Hi all, I have two
DateTime
fields in
datamodel
,
updatedAt
and
lastSyncedAt
. How could I get IDs of all records with
lastSyncedAt
lesser than
updatedAt
, that is, non-synced records? Thank you 🙂
@Harshit suggested this to do:
>> well this is not currently possible right now, bit of a complex aggregation
use executeRaw although we have a aggregation spec that will be coming with prisma 2 https://github.com/prisma/rfcs/blob/prisma-basic-aggregation-support/text/0000-prisma-basic-aggregation-support.md SELECT * FROM yourtype WHERE lastupdatedat < syncedat and remember to appened it with your service name