Hey guys,
What’s the most performant way to check if an object exists in the database without fetching it’s data?
Currently I’m excluding all fields and using query.first()
.
However if I add a new field to that class I’ll have to update my code to exclude that new field too.
- Is there something like a
query.exists()
? - If I want to
.select(**NOTHING**)
, what’s the correct way to do it? (even thought this downloads some unnecessary data like_id
and_created_at
at least it would be easier to maintain.
Thanks in Advance.