This is wrong I'm afraid and should not be accepted.
As in almost any database milieu, the trick is to set the fetch limit to 1.
(Unrelated, note that with SwiftData (as of writing) when you're getting all items, there's no extra performance in getting only some columns - it's just a convenience measure.)
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: