-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot index a property using TypeScript #6607
Comments
➤ PM Bot commented: Jira ticket: RJS-2799 |
@thegreatzeus Thank you for reporting. We need to investigate. |
I've literally been having same issue! in my case I'm just trying to create a basic model like so
|
@thegreatzeus any leads yet? |
Same issue here. Using @thegreatzeus class as example, if I just define my scheme as the following, it works fine
If I add the Is there any work around so far? |
this is what I ended up using @jpbast |
@favourwright it worked for me! Thanks for your quick reply |
@thegreatzeus, it looks like you're using the @realm/babel-plugin. The idea of that plugin is to simplify some of the model/schema creation by removing the need for the explicit You can either remove the plugin and use the schema as you have defined it, or use the plugin and remove the To index a property using the babel-plugin, use the The following is a similar example as the @realm/babel-plugin README: class Task extends Realm.Object<Task, "description"> {
_id = new Realm.BSON.ObjectId();
description!: string;
@index
isComplete = false;
static primaryKey = "_id";
} |
How frequently does the bug occur?
Always
Description
I'm trying to index a
string
property on a Realm model using TypeScript.I'm using Realm's React Native SDK with Realm's Expo example app.
Using the same example from Realm's docs:
Results in the following error:
Stacktrace & log output
Version
"realm": "12.0.0", "@realm/react": "^0.6.0",
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Android 14
Build environment
Node v18.19.1
package.json
contents:Cocoapods version
No response
The text was updated successfully, but these errors were encountered: