Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-165

Access the db in native module

      <!---

      Questions: If you have questions about HOW TO use Realm, please ask on
      StackOverflow: http://stackoverflow.com/questions/ask?tags=realm
      We monitor the realm tag.

      Feature Request: Just fill in the first two sections below.

      Bugs: To help you as fast as possible with an issue please describe your issue
      and the steps you have taken to reproduce it in as much detail as possible.

      -->

      Goals

      <!--- What are you trying to achieve? -->

      When I have a lot data in Realm DB, and I need to do some statistics on them, for example, SUM them all, this time, doing this at javascript become pretty slow, looks like UI is frozen.
      So I am thinking, is it possible to access Realm DB in a native module and then doing this data processing there?

      Expected Results

      I am expecting that the Realm could support this, as I can access the Realm default db at native module, and then I found that's not connivence.

      <!--- What did you expect to happen? -->

      Actual Results

      In Android scenario, the java API from Realm docs, provide way to access the data, but it required defined Model to access, like this:

      public class Person extends RealmObject {
        private String id;
        private String name;
        private RealmList<Dog> dogs;
        // getters and setters
      }
      
      realm.where(Person.class)
                                      .equalTo("dogs.color", "Brown")
                                      .findAll();
      

      So now the problem is, the Realm Schema already defined in javascript, then if I was going to write a certain native module to access the db at Java, I will have to define them all in Java too, and then try to query the data.

      So is it possible to have some API to query the db directly by using schema name too? Just like it was in javascript, ``Realm.objects(schemaName)...``

      <!--- What happened instead? -->
      <!--- e.g. the stack trace of a crash -->

      Steps to Reproduce

      <!--- What are steps we can follow to reproduce this issue? -->

      Code Sample

      <!---
      Please provide a code sample or test case that highlights the issue.
      If relevant, include your model definitions.
      For larger code samples, links to external gists/repositories are preferred.
      Full projects that we can compile and run ourselves are ideal!
      -->

      Version of Realm and Tooling

      • Realm JS SDK Version: ?
      • Node or React Nattive: ?
      • Client OS & Version: ?
      • Which debugger for React Native: ?/None
      • Realm JS 1.10.1
      • Realm Java 3.5.0
      • React Native
      • Android Version 5.1.1

      React Native

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: