Correct way to retrieve a single object from Realm database

object(ofType:forPrimaryKey:) is what you’re looking for: Realm().object(ofType: Book.self, forPrimaryKey: prevBook.nextId). There’s no simpler way than filter().first if you need to search for the object by something other than the primary key.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)