question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Realm pattern matching in react-native/reactjs

See original GitHub issue

I have this line of code: realm.objects('Users').filtered("profile LIKE '%athletic%'")

It gave the error profile LIKE ‘%athletic%’:1:0: Invalid predicate when running the program. I am unable to find documentation for pattern matching in react-native-realm. How do I find records that return users who have profiles with the string athletic in it?

I’m using react-native and realm together to do this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
knethcommented, Jun 14, 2018

Yes, and our new query parser also supports profile LIKE '*athletic*'.

1reaction
Zhuindencommented, Dec 4, 2017

@kneth technically he was looking for CONTAINS, so it worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-realm pattern matching causes invalid predicate
It gave the error profile LIKE '%athletic%':1:0: Invalid predicate when running the program. I am unable to find documentation for pattern ...
Read more >
Query Data - React Native SDK — Realm - MongoDB
You can compare string values using string operators like == , beginsWith , contains , and endsWith . You can also use the...
Read more >
react-native-realm pattern matching causes invalid predicate ...
Coding example for the question react-native-realm pattern matching causes invalid predicate-React Native.
Read more >
Getting started with Realm for React Native | by mbvissers.eth
With SQLite you'd find yourself writing queries while in Realm you can access the data like it is a object in your JavaScript....
Read more >
How to Integrate MongoDB Realm with React: Part 1
Next, we need to select a permission template. Permission templates allow to easily restrict read and write access as necessary. In the website ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found