[5.0.0] Android returns Results with length 1 but no keys or values
See original GitHub issueGoals
I am trying to fetch some objects from database.
Expected Results
Getting 1 object with all properties.
Actual Results
I get Results of length 1 but when getting the object via index 0, it returns no properties.
Steps to Reproduce
Run the code on Android
Code Sample
const results = realm
.objects<ImporterAuthenticationModel>(ImporterAuthenticationModel.schema.name)
.filtered('importerId = $0', importer.importer.id);
if (results) {
console.log(results.length);
console.log(results[0].id);
}
Output is:
1
undefined
Schema:
export class ImporterAuthenticationModel extends BaseModel {
public static schema = {
...BaseModel.schema,
name: 'ImporterAuthenticationModel',
primaryKey: 'uniqueId',
properties: {
...BaseModel.schema.properties,
uniqueId: 'string',
id: 'string',
title: 'string',
subTitle: 'string?',
imageUrl: 'string?',
importerId: 'string',
additionalDataString: 'string?',
rawStatus: { type: 'int', default: ImporterAuthenticationStatus.AUTHENTICATED },
expiresAt: 'int'
}
};
Version of Realm and Tooling
- Realm JS SDK Version: 5.0.0
- Node or React Native: React Native
- Client OS & Version: Android 9PKQ1.181121.001 (Mi 9 Lite)
- Which debugger for React Native: React Native Debugger (but it also fails if using production build from FireBase)
Issue Analytics
- State:
- Created 4 years ago
- Comments:33 (14 by maintainers)
Top Results From Across the Web
Android 5.0 Compatibility Definition
A value chosen by the device implementer containing the name of the device as known to the end user. This SHOULD be the...
Read more >Array Length returns 0 - Stack Overflow
Your Array needs a numeric input, you're currently using an empty string as an Index, which is invalid. You can either specify an...
Read more >Voice Android SDK Changelog | Twilio
The SDK compileSDKVersion and targetSDKVersion were updated to 30 from 28. No changes are required to migrate to this version in an existing...
Read more >Android Developers Guide | Parse
Values can be strings, numbers, booleans, or even arrays and objects - anything that can be JSON-encoded. Each ParseObject has a class name...
Read more >Realm: Create reactive mobile apps in a fraction ... - MongoDB
findAll(); puppies.size(); // => 0 because no dogs have been added to the ... You can use the standalone Realm Browser Mac application...
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
I am facing the same issue. Android its not working. iOS Working.
This is the results i am getting in Android Device.
iOS (Simulator) it’s working as expected Realm without any issues…
Same problem is here. But our project uses
realm.objects()
methods everywhere and some method call is fine but others not working.Upon investigation, we found that it worked fine for classes that inherited from
Realm.Object
, but returned an empty object for classes that didn’t. This is odd.Working correctly:
Not working correctly:
“realm”: “^6.0.1” (yarn.lock says 6.0.1) “react-native”: “0.61.5”,
iOS Simulator: iPhone 11 (13.1)