Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Query Realm DB Browser?

Tags:

realm

https://i.stack.imgur.com/G1iXY.pngRealm DB

I need to filter the DB on the basis of Id. On top there is search bar stating "Enter the query to filter the list". How to query to get some specific id filtered in RealmDB browser.

My DB URL: https://i.stack.imgur.com/G1iXY.png

like image 781
Ankur Prakash Avatar asked Jan 26 '23 22:01

Ankur Prakash


1 Answers

That field is used to enter queries aka Filter. Suppose you have a Dog Class with a dog_name property. To search for a Dog with the name Fido, you would enter this into the field

dog_name == "Fido"

The field is evaluated live so as soon as a valid query is entered, the results are updated.

If you look at the docs (this is Swift) you will see an example like this

// Query using a predicate string
var tanDogs = realm.objects(Dog.self).filter("color = 'tan' AND name BEGINSWITH 'B'")

To apply the same filter, just use the part within the quotes in Realm Studio

color = 'tan' AND name BEGINSWITH 'B'
like image 171
Jay Avatar answered Feb 03 '23 06:02

Jay