Questions tagged [realm-js]

Realm is a mobile database: an alternative to SQLite & key-value stores

Links

  1. Github

  2. Site

  3. Documentation

55 questions
1
vote
1 answer

RealmJS: Correct query to fetch object from list with AND consition

Schema of Product has many details like: productName, manufactured date, manufacturer name, product type etc. But I need to support flexibility of having no defined schema for product details. To achieve this below is the Realm-JS schema. import…
Raviprakash
  • 2,410
  • 6
  • 34
  • 56
1
vote
1 answer

How to collect data from multiple schemas ? - Realm

I am new in Realm database, it's amazing, and I've few doubts about the relationship thing. Rather than asking each doubt, I prefer to understand it from an example. Below given a sample schema copied from realm javascript docs. const CarSchema = { …
theapache64
  • 10,926
  • 9
  • 65
  • 108
0
votes
0 answers

Close or Kill a node js realm sync process for a synced realm

Realm process does not exit when I am closing realm only in case of synced realm. My main issue is I am using Synced Realm with Electron and when I close the electron application, it keeps running in background (doesn’t get killed, the synced realm…
0
votes
1 answer

Realm data type for dynamic key name pair and values

I am working with realm flexible sync in react native and i want to define schema for below json where key names are dynamic objectId and has set of properties so i tried dictionary and mixed but didn't worked. Also this group_taxes would have n of…
0
votes
0 answers

How to read/write realm database created in react native via native/turbo/expo modules?

Should I use realmjs for react native, realm-kotlin for android and realm-swift for iOS? Is there any documentation giving guidance on how to achieve this? I found it really hard to do it I don't know where to start it. Please help thank you.
Bruce
  • 457
  • 1
  • 5
  • 18
0
votes
2 answers

Realm: create causing a crash within android (react-native)

The example below is working fine while in debug is enabled using React Native Debugger but the app is crashing in normal mode for Android only. Can someone assist me resolve this issue, please? const Cat = { name: "Cat", properties: { …
0
votes
1 answer

Computed property in realm. How to update a different realm from a realm collection listener?

I'm building a chat app. Each channel has many messages. I am building the channel list view where I want to display all the channels sorted by the most recent message sent at per channel. Each time a message is sent or received I would like to keep…
david_adler
  • 9,690
  • 6
  • 57
  • 97
0
votes
0 answers

Why is this Realm write function throwing "realm is already in a write transaction" error?

In a react-native app, using realm.js, the below function is throwing The realm is already in a write transaction error. function definition: export const addJob = (params) => { const job = { ...params, id: uuid.v4(), account:…
Jim
  • 1,988
  • 6
  • 34
  • 68
0
votes
1 answer

Is there a way to present One2Many Relation in correct way in realm?

I have a very simple schema structure in my mobile app: export const DepositSchema = { name: "Deposit", properties: { uuid: "string", payments: "Payment[]", }, primaryKey: "uuid", }; export const PaymentSchema = { name:…
Jaroslaw K.
  • 5,224
  • 2
  • 39
  • 65
0
votes
1 answer

How to fix 'RealmObject cannot be called as a function' realm-js error?

In a react-native project using Realm-js, I've just created a clone of the app, integrated all libs, and copied over all src directories. The app builds installs and runs on Android. When i go through the authentication flow (which utilizes realm to…
Jim
  • 1,988
  • 6
  • 34
  • 68
0
votes
1 answer

objectForPrimaryKey vs filtered query(to match primary key) performance, which one is faster for large data?

Here I'm giving an example class TestRealm { constructor(realmDB) { this.realmDB = realmDB; this.allRealm = this.realmDB.objects('Person'); } query1(primary_key) { try { const response =…
0
votes
1 answer

How long are mongodb realms retained on a device by default?

How long are mongodb realms retained on a device running the application by default (Sync/Normal) Does it matter if its a normal or synced realm? If so whats the default retention by the device for both?
0
votes
1 answer

Realm Javascript filtered on Date but ignore year

I am attempting to query in RealmJS on a Date field for birthdays. I want to find all the people that have a birthday today. The problem is that I can't ignore the year. Is there a way to do this? My code: const today = new Date(); const morning =…
Kurt
  • 3
  • 2
0
votes
2 answers

Error in React Native with RealmJS- Command PhaseScriptExecution failed with a nonzero exit code

Using Node.js v12.13.0 internal/modules/cjs/loader.js:797 throw err; ^ Error: Cannot find module '/Users/ABC/Projects/ReactNative/Project ABCD' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15) at…
amk
  • 11
  • 2
0
votes
1 answer

Is there a way to set permissions for a "reference" Realm, using full sync?

Since Realm is no longer recommending query-based sync (https://docs.realm.io/sync/using-synced-realms/choosing-your-sync-type#query-based-sync), I've decided to switch to full sync and now I'm facing a problem with the user permissions. I can't set…
Buzzkill
  • 68
  • 2
  • 8