From the course: Learning Realm for iOS App Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Queries and filters

Queries and filters - iOS Tutorial

From the course: Learning Realm for iOS App Development

Start my 1-month free trial

Queries and filters

- [Narrator] So far we can only retrieve all objects for a given type from our database. For that we're using the objects function here in line 35 in our demo project and we're looking for the specific type of note. But in many cases you actually want to query for something very specific, like a specific word in a title or in a note. And now we're going to have a look at how you can do that and if you want to experiment a little more with more notes, I've currently three notes in my database, then just run this code that is currently present in comments here. Run this code a few times, change the title, change the content, or create a for-loop that iterates through the creation of several objects that might make it more interesting for you. But to understand the principal, it's very good to have just a few notes. With that we can experiment a little better, so just in case you wanted to change that. And what we want to do now here is first of all, remove all of that code again except…

Contents