handling whitespaces in column names
See original GitHub issueI can’t find anything in documentations about how to filter on columns with whitespace in names.
Goals
do filtering on fields containing whitespaces.
Actual Results
Invalid predicate.
exception
Code Sample
realm.objects('course').filtered('lessons list.@size == 2');
Version of Realm and Tooling
- Node or React Native: ? Node
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to deal with white spaces in Column Names of your Raw ...
I have a raw file in my AWS S3 bucket. I have mounted the S3 bucket with my Databricks instance, that's how I...
Read more >How to write SQL queries with spaces in column names
In this article, we are going to learn how we can write a SQL query with space in the column name. Blanks spaces...
Read more >How to remove trailing whitespaces from column headers in ...
In this blog post we'll do a small thing to remove trailing or leading whitespaces from a DataFrame's column names.
Read more >How can I strip the whitespace from Pandas DataFrame ...
This is where my mind went since I like to strip whitespace earlier in my process flow and handle incoming data with variable...
Read more >Remove spaces from column names in Pandas - GeeksforGeeks
Removing spaces from column names in pandas is not very hard we easily remove spaces from column names in pandas using replace() function....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@noorzaie
But your UI tool opens the Realm right?
Using
mapTo
will not change the schema. Instead it adds an alias available only for your client while the Realm is opened. It could be a transformation of the name, that doesn’t contain a whitespace such that it can be used in queries.You could:
mapTo
for each of the properties.mapTo
s (which will not make any changes to the schema of the Realm file).mapTo
property names instead of the ones containing whitespaces.Example implementation
Somewhere else …
This might contain errors - as I havn’t actually run it, but it should demonstrate the idea - does it? 😃
@kraenhansen That sounds great. Thanks so much for explanation and sample code. I’ll try it.