Realm does not synchronize records


I am working on a React Native app, but unfortunately the synchronization between the app and Atlas is not working. The structure of my app follows exactly the template:

<AppProvider id={process.env.REALM_APP_ID}>
    <UserProvider fallback={<SignIn />}>
        <RealmProvider sync={{
            flexible: true,
            onError: error => console.error(error)
            <App />

Nevertheless, I don’t get any results with useQuery(), although records are available in Atlas.

const data = useQuery(Data)

==> 0

I am on:

  • @realm/react”: “^0.4.1”
  • “realm”: “^11.3.1”

In MongoDB Compass I can see that a collection “state_data” has been created in the database “_realm_sync…”. Why can’t I access the data? What can be the reason for this?

Many greetings

Quick check: Have you followed the steps in this guide and changed e.g. the App ID (generating via realm-cli should get this right automatically)?

1 Like

I was able to solve the issue by subscribing to the object:

realm.subscriptions.update(mutableSubs => {

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.